asp.net App.config配置文件帮助类

        /// <summary>
        /// 保存app.config设定
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public static void SaveAppConfig(string key, string value)
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            config.AppSettings.Settings[key].Value = value;
            config.Save(ConfigurationSaveMode.Modified);
        }

 

posted @ 2012-08-11 14:57  狄大人  阅读(343)  评论(0编辑  收藏  举报