zoukankan      html  css  js  c++  java
  • winform 读取保存配置文件

    原文连接:


            public static string fileName = System.IO.Path.GetFileName(Application.ExecutablePath);
            public static bool addSetting(string key, string value)
            {
                Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(fileName);
                config.AppSettings.Settings.Add(key, value);
                config.Save();
                return true;
            }
            public static string getSetting(string key)
            {
                Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(fileName);
                string value = config.AppSettings.Settings[key].Value;
                return value;
            }
            public static bool updateSeeting(string key, string newValue)
            {
                Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(fileName);
                string value = config.AppSettings.Settings[key].Value = newValue;
                config.Save();
                return true;
            }

  • 相关阅读:
    ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
    pycocotools使用教程
    with torch.no_grad() 详解
    虚拟机Ubuntu上下载Pytorch显示超时
    Deep Layer Aggregation DLA网络的结构
    tgz文件解压命令
    install mysql at linux
    devops issue
    process data
    unittest
  • 原文地址:https://www.cnblogs.com/lsysunbow/p/5056015.html
Copyright © 2011-2022 走看看