Esempio n. 1
0
            /// <summary>
            /// 使用初始化
            /// </summary>
            internal static void Initialize(string path)
            {
                // 创建默认配置
                if (!System.IO.File.Exists(path))
                {
                    using (var cfg = new dpz3.File.ConfFile(path)) {
                        var group = cfg["Ecp"];
                        group["url"] = "https://v5.lywos.com";
                        group["id"]  = "";
                        group["key"] = "";
                        cfg.Save();
                    }
                }

                using (var cfg = new dpz3.File.ConfFile(path)) {
                    Ecp = new ApiInfo(cfg["Ecp"]);
                }
            }
Esempio n. 2
0
            /// <summary>
            /// 使用初始化
            /// </summary>
            public static void Initialize(string path)
            {
                // 创建默认配置
                if (!System.IO.File.Exists(path))
                {
                    using (var cfg = new dpz3.File.ConfFile(path)) {
                        var group = cfg["default"];
                        group["url"]     = "http://127.0.0.1:8080";
                        group["ws"]      = "";
                        group["storage"] = "";
                        group["develop"] = "0";
                        cfg.Save();
                    }
                }

                _cfg    = new dpz3.File.ConfFile(path);
                Default = GetInfo("default");
            }
Esempio n. 3
0
            /// <summary>
            /// 使用初始化
            /// </summary>
            internal static void Initialize(string path)
            {
                // 创建默认配置
                if (!System.IO.File.Exists(path))
                {
                    using (var cfg = new dpz3.File.ConfFile(path)) {
                        var group = cfg["default"];
                        group["port"]    = "8601";
                        group["passwd"]  = "000000";
                        group["timeout"] = "3600";
                        cfg.Save();
                    }
                }

                using (var cfg = new dpz3.File.ConfFile(path)) {
                    var group = cfg["default"];
                    Port     = group["port"].ToInteger();
                    Password = group["passwd"];
                    Timeout  = group["timeout"].ToInteger();
                }
            }
Esempio n. 4
0
            /// <summary>
            /// 使用初始化
            /// </summary>
            internal static void Initialize(string path)
            {
                // 创建默认配置
                if (!System.IO.File.Exists(path))
                {
                    using (var cfg = new dpz3.File.ConfFile(path)) {
                        var group = cfg["default"];
                        group["ip"]       = "127.0.0.1";
                        group["port"]     = "8601";
                        group["password"] = "******";
                        cfg.Save();
                    }
                }

                // 读取配置
                using (var cfg = new dpz3.File.ConfFile(path)) {
                    var group = cfg["default"];
                    IPAddress = group["ip"];
                    Port      = group["port"].ToInteger();
                    Password  = group["password"];
                }
            }