C# 动态修改Config
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Remove("Custom"); config.AppSettings.Settings.Add("Custom", txtValue.Text); config.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection("appSettings");