diff --git a/Update.cs b/Update.cs index 261f772..0fb0ed6 100644 --- a/Update.cs +++ b/Update.cs @@ -1022,28 +1022,23 @@ namespace CheckDownload /// /// 初始化程序使用的临时目录,用于存储下载过程中的临时文件 /// - private void InitializeTempDirectory() - { - try - { - string exeDir = AppDomain.CurrentDomain.BaseDirectory; - - _tempDirectory = Path.Combine(exeDir, "Temp"); - - if (File.Exists(_tempDirectory)) - { - throw new IOException($"无法创建目录,因为已存在同名文件: {_tempDirectory}"); - } - - if (!Directory.Exists(_tempDirectory)) - { - Directory.CreateDirectory(_tempDirectory); - } - } - catch (Exception ex) - { - throw new Exception("初始化临时目录 (InitializeTempDirectory)", ex); - } + private void InitializeTempDirectory() + { + try + { + string exeDir = AppDomain.CurrentDomain.BaseDirectory; + + _tempDirectory = Path.Combine(exeDir, "Temp"); + + if (!Directory.Exists(_tempDirectory)) + { + Directory.CreateDirectory(_tempDirectory); + } + } + catch (Exception ex) + { + throw new Exception("初始化临时目录 (InitializeTempDirectory)", ex); + } } ///