////// 更新配置文件信息 /// /// 配置文件字段名称 /// 值 public void UpdateConfig(string name, string Xvalue) { Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); cfa.AppSettings.Settings[name].Value = Xvalue; cfa.Save(); System.Configuration.ConfigurationManager.RefreshSection("appSettings"); } ////// 读取配置文件信息 /// /// ///public string GetConfig(string name) { return System.Configuration.ConfigurationManager.AppSettings[name]; }