improve:墨迹保存

This commit is contained in:
CJK_mkp
2025-06-08 23:47:27 +08:00
parent c2f2f3a9af
commit a3b61d984d
2 changed files with 127 additions and 109 deletions
+5 -1
View File
@@ -100,7 +100,11 @@ namespace Ink_Canvas {
Directory.CreateDirectory(fullPath);
}
}
catch (Exception) {
catch (Exception ex) when
(ex is IOException ||
ex is UnauthorizedAccessException ||
ex is DirectoryNotFoundException) // 明确捕获与目录创建相关的异常
{
// 如果创建失败则使用文档目录
basePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
fullPath = Path.Combine(basePath, "Auto Saved - Screenshots", dateFolder);