From b48dae9c33dc5ccc92dbc743e1a5cf4b7f481c5d Mon Sep 17 00:00:00 2001 From: zqm Date: Fri, 31 Oct 2025 09:13:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Camera.cs=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E6=96=B0=E4=BF=9D=E5=AD=98=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Windows/CS/Framework4.0/Toprie/Toprie/Camera.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/Camera.cs b/Windows/CS/Framework4.0/Toprie/Toprie/Camera.cs index 3cafd86..b4dfd0d 100644 --- a/Windows/CS/Framework4.0/Toprie/Toprie/Camera.cs +++ b/Windows/CS/Framework4.0/Toprie/Toprie/Camera.cs @@ -1715,24 +1715,25 @@ namespace JoyD.Windows.CS.Toprie }; // 设置保存对话框的初始目录为ProjectPath属性的值 - if (!string.IsNullOrEmpty(ProjectPath)) + String SavePath = String.IsNullOrWhiteSpace(ProjectPath) ? Application.StartupPath : ProjectPath; + if (!string.IsNullOrEmpty(SavePath)) { // 确保目录存在 - if (Directory.Exists(ProjectPath)) + if (Directory.Exists(SavePath)) { - saveFileDialog.InitialDirectory = ProjectPath; + saveFileDialog.InitialDirectory = SavePath; } else { // 尝试创建目录 try { - Directory.CreateDirectory(ProjectPath); - saveFileDialog.InitialDirectory = ProjectPath; + Directory.CreateDirectory(SavePath); + saveFileDialog.InitialDirectory = SavePath; } catch (Exception ex) { - Console.WriteLine($"创建项目路径目录失败: {ex.Message}"); + Console.WriteLine($"创建保存路径目录失败: {ex.Message}"); // 如果创建目录失败,则不设置初始目录,使用默认行为 } }