mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-19 09:35:48 +08:00
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -55,4 +55,22 @@ public class RepoWebBridge
|
||||
await MessageBox.ShowAsync(e.Message, "订阅脚本链接失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> GetUserConfigJson()
|
||||
{
|
||||
try
|
||||
{
|
||||
string userConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "User", "config.json");
|
||||
if (!File.Exists(userConfigPath))
|
||||
{
|
||||
throw new Exception("用户配置文件不存在: " + userConfigPath);
|
||||
}
|
||||
return await File.ReadAllTextAsync(userConfigPath);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
await MessageBox.ShowAsync(e.Message, "获取用户配置失败");
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user