Пример #1
0
        /// <summary>
        /// 设置配置组信息
        /// </summary>
        /// <param name="group"></param>
        public void SetConfigGroup(dpz3.File.Conf.SettingGroup group)
        {
            settingGroup = group;

            // 清理所有行
            this.dataGridView1.Rows.Clear();
        }
Пример #2
0
 /// <summary>
 /// 对象实例化
 /// </summary>
 /// <param name="dir"></param>
 public Manager(string dir)
 {
     _dir = dir.Replace("\\", "/");
     if (!_dir.EndsWith("/"))
     {
         _dir += "/";
     }
     _conf_path = $"{_dir}list.config";
     _conf      = new File.ConfFile(_conf_path);
     _group     = _conf["default"];
     idxer      = _group["indexer"].ToLong();
 }
Пример #3
0
        /// <summary>
        /// 对象实例化
        /// </summary>
        /// <param name="path"></param>
        public KestrelConfig(string path) : base(path)
        {
            bool needSave = false;

            _server = base["Server"];
            if (!_server.ContainsKey("Enable"))
            {
                this.Enable = false;
                needSave    = true;
            }

            // 初始化HTTP配置
            _http = base["HTTP"];
            if (!_http.ContainsKey("Enable"))
            {
                this.HttpEnable = false;
                needSave        = true;
            }
            if (!_http.ContainsKey("Port"))
            {
                this.HttpPort = 80;
                needSave      = true;
            }

            // 初始化HTTPS配置
            _https = base["HTTPS"];
            if (!_https.ContainsKey("Enable"))
            {
                this.HttpsEnable = false;
                needSave         = true;
            }
            if (!_https.ContainsKey("Port"))
            {
                this.HttpsPort = 8080;
                needSave       = true;
            }
            if (!_https.ContainsKey("Pfx.Path"))
            {
                this.HttpsPfxPath = "/ssl/ssl.pfx";
                needSave          = true;
            }
            if (!_https.ContainsKey("Pfx.Password"))
            {
                this.HttpsPfxPwd = "123456";
                needSave         = true;
            }

            // 需要保存
            if (needSave)
            {
                base.Save();
            }
        }
Пример #4
0
 /// <summary>
 /// 对象实例化
 /// </summary>
 /// <param name="path"></param>
 public ConfigFile(string path) : base(path)
 {
     _def = base["default"];
     _pwd = base["password"];
 }