首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C# 读取配置文件跟修改

2012-11-13 
C# 读取配置文件和修改读取:string str ConfigurationManager.AppSettings[key]?写入:?Configuration

C# 读取配置文件和修改

读取:

string str= ConfigurationManager.AppSettings["key"];
?

写入:

?Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
?configuration.AppSettings.Settings[key].Value = result;
configuration.Save();
ConfigurationManager.RefreshSection("appSettings");

热点排行