From dd213504ad5181cb892b9bb7db87db815a0875ef Mon Sep 17 00:00:00 2001 From: DouDou Date: Fri, 22 Aug 2025 23:45:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=B4=E6=97=B6=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=88=9D=E5=A7=8B=E5=8C=96=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=AF=B9=E5=B7=B2=E5=AD=98=E5=9C=A8=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E6=A3=80=E6=9F=A5=EF=BC=8C=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=88=9B=E5=BB=BA=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Update.cs | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) 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); + } } ///