From 4f7c1021c88f89a4fede26e3de132b29fe8ba35f Mon Sep 17 00:00:00 2001 From: unknown <2564608840@qq.com> Date: Tue, 15 Jul 2025 20:33:47 +0800 Subject: [PATCH] =?UTF-8?q?improve:=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E4=BF=9D=E5=AD=98=E4=BA=86=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/Windows/AddCustomIconWindow.xaml.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Ink Canvas/Windows/AddCustomIconWindow.xaml.cs b/Ink Canvas/Windows/AddCustomIconWindow.xaml.cs index c429e5ed..1dde9b82 100644 --- a/Ink Canvas/Windows/AddCustomIconWindow.xaml.cs +++ b/Ink Canvas/Windows/AddCustomIconWindow.xaml.cs @@ -74,19 +74,26 @@ namespace Ink_Canvas { try { - // 创建pictures文件夹(如果不存在) + // 创建pictures/icons文件夹结构(如果不存在) string picturesFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "pictures"); + string iconsFolder = Path.Combine(picturesFolder, "icons"); + if (!Directory.Exists(picturesFolder)) { Directory.CreateDirectory(picturesFolder); } + if (!Directory.Exists(iconsFolder)) + { + Directory.CreateDirectory(iconsFolder); + } + // 生成一个唯一的文件名(使用GUID) string extension = Path.GetExtension(selectedFilePath); string newFileName = $"{Guid.NewGuid()}{extension}"; - string destPath = Path.Combine(picturesFolder, newFileName); + string destPath = Path.Combine(iconsFolder, newFileName); - // 复制文件到pictures文件夹 + // 复制文件到pictures/icons文件夹 File.Copy(selectedFilePath, destPath); // 创建新的自定义图标对象