解决Settings被占用无法读取的问题

croire 3 years ago
parent a5f7b1e7ac
commit ce9b292500

@ -57,9 +57,11 @@ namespace DownKyi.Core.Settings
{
try
{
StreamReader streamReader = File.OpenText(settingsName);
FileStream fileStream = new FileStream(settingsName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
StreamReader streamReader = new StreamReader(fileStream, System.Text.Encoding.UTF8);
string jsonWordTemplate = streamReader.ReadToEnd();
streamReader.Close();
fileStream.Close();
#if DEBUG
#else

@ -144,7 +144,7 @@ namespace DownKyi.ViewModels.Settings
// 弹幕字体
string danmakuFont = SettingsManager.GetInstance().GetDanmakuFontName();
if (Fonts.Contains(danmakuFont))
if (danmakuFont != null && Fonts.Contains(danmakuFont))
{
// 只有系统中存在当前设置的字体,才能显示
SelectedFont = danmakuFont;

Loading…
Cancel
Save