zoukankan      html  css  js  c++  java
  • 修改config配置文件

            public static void SetValue(string key, string value)
            {
                string file = System.Windows.Forms.Application.ExecutablePath;
    
                Configuration configuration = ConfigurationManager.OpenMappedExeConfiguration(new ExeConfigurationFileMap
                {
                    ExeConfigFilename = file + ".config"
                }, ConfigurationUserLevel.None);
                configuration.AppSettings.Settings[key].Value = value;
                configuration.Save();
            }

     配置文件刷新

    ConfigurationManager.RefreshSection("appSettings");
  • 相关阅读:
    git
    读后感
    总结
    封装,策略,Asp换脸
    典型用户
    第四次作业
    第三次作业
    计算
    感悟
    对git的认识
  • 原文地址:https://www.cnblogs.com/leebokeyuan/p/12678394.html
Copyright © 2011-2022 走看看