读
this.txtOutPutPath.Text = ConfigurationManager.AppSettings["OutPutPath"]; this.txtFilter.Text = ConfigurationManager.AppSettings["Filter"];
写
Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); configuration.AppSettings.Settings["OutPutPath"].Value = this.txtOutPutPath.Text; configuration.AppSettings.Settings["Filter"].Value = this.txtFilter.Text; //保存配置文件 configuration.Save(); ConfigurationManager.RefreshSection("appSettings"); // 实时刷新
时间: 2024-10-04 12:13:41