修改深色模式切换方式,改为Json
This commit is contained in:
parent
9390e7ce8a
commit
7f2ccb2ef8
@ -87,7 +87,12 @@ namespace AntdUIDemo
|
|||||||
|
|
||||||
private void Button_color_Click(object sender, EventArgs e)
|
private void Button_color_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var value = ConfigurationManager.AppSettings["ColorMode"];
|
// 读取 appsettings.json 文件
|
||||||
|
var configFilePath = "appsettings.json";
|
||||||
|
var json = File.ReadAllText(configFilePath);
|
||||||
|
var jsonObj = JObject.Parse(json);
|
||||||
|
var appSettings = jsonObj["AppSettings"];
|
||||||
|
var value = appSettings["ColorMode"]?.ToString();
|
||||||
if (value == "Auto")
|
if (value == "Auto")
|
||||||
{
|
{
|
||||||
//反向设置
|
//反向设置
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user