improve:安全面板

This commit is contained in:
2026-03-28 16:46:35 +08:00
parent bb1b893961
commit fd137ae787
2 changed files with 12 additions and 4 deletions
+6 -2
View File
@@ -1,4 +1,4 @@
using Ink_Canvas.Helpers;
using Ink_Canvas.Helpers;
using System;
using System.ComponentModel;
using System.IO;
@@ -38,7 +38,11 @@ namespace Ink_Canvas
var result = MessageBox.Show("是否保存?", "名单导入", MessageBoxButton.YesNo);
if (result == MessageBoxResult.Yes)
{
File.WriteAllText(App.RootPath + "Names.txt", TextBoxNames.Text);
var path = App.RootPath + "Names.txt";
ProcessProtectionManager.WithWriteAccess(path, () =>
{
File.WriteAllText(path, TextBoxNames.Text);
});
}
}
}