读取:
string str= ConfigurationManager.AppSettings["key"];
写入:
Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
configuration.AppSettings.Settings[key].Value = result;
configuration.Save();
ConfigurationManager.RefreshSection("appSettings");