SettingsManager类添加异常捕获

croire 3 years ago
parent f93306509d
commit f7cd3c734c

@ -82,16 +82,16 @@ namespace DownKyi.Core.Settings
/// <returns></returns> /// <returns></returns>
private bool SetSettings() private bool SetSettings()
{ {
string json = JsonConvert.SerializeObject(appSettings); try
{
string json = JsonConvert.SerializeObject(appSettings);
#if DEBUG #if DEBUG
#else #else
// 加密字符串 // 加密字符串
json = Encryptor.EncryptString(json, password); json = Encryptor.EncryptString(json, password);
#endif #endif
try
{
File.WriteAllText(settingsName, json); File.WriteAllText(settingsName, json);
return true; return true;
} }

Loading…
Cancel
Save