【发布时间】:2014-11-19 21:28:03
【问题描述】:
我正在努力尝试修改我的应用程序的 app.config 文件的 appSettings 部分。但是我没有收到任何错误/异常,我可以毫无问题地读取值。 这是我尝试设置值的方式:
ConfigurationManager.AppSettings.Set("DaysLeft", Days.Text.ToString());
//
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings["DaysLeft"].Value = Days.Text.ToString();
//when I debug the app, I notice that the value is changed in the previous line
app.config 文件未被修改。
【问题讨论】:
标签: c# app-config appsettings