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");

 

posted @ 2016-05-04 16:26  oiliu  阅读(1391)  评论(0编辑  收藏  举报