zoukankan      html  css  js  c++  java
  • 配置文件操作方法

     1  Configuration windowsConfig = ConfigurationManager.OpenExeConfiguration(Path.Combine(Application.StartupPath, "WindowsFormsHost.exe"));
     2
     3            windowsConfig.AppSettings.Settings["ConnectionString"].Value = desCheck.Checked ? DESEncrypt.Encrypt(connText.Text) : connText.Text ;
     4            windowsConfig.AppSettings.Settings["ConStringEncrypt"].Value = desCheck.Checked.ToString();
     5           
     6            windowsConfig.Save();
     7
     8            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
     9
    10            config.AppSettings.Settings["ConnectionString"].Value = desCheck.Checked ? DESEncrypt.Encrypt(connText.Text) : connText.Text;
    11            config.AppSettings.Settings["ConStringEncrypt"].Value = desCheck.Checked.ToString();
    12
    13            config.Save();
    14
  • 相关阅读:
    Quartz
    WebService
    JavaMail
    安装phpnow服务[Apache_pn]提示失败的解决方法
    idea安装激活
    csdn下载
    java解析json串常识
    Oracle错误——ORA-03113:通信通道的文件结尾
    SSM(Maven集成)
    SpringMVC的拦截器
  • 原文地址:https://www.cnblogs.com/guozk/p/1540221.html
Copyright © 2011-2022 走看看