C# 读取配置文件和修改

读取:

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

写入:

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

你可能感兴趣的:(C++,c,C#)