Example #1
0
        public static string Start()
        {
            ConfigReadWrite rw = new ConfigReadWrite();

            try
            {
                openServerUrl           = lib.pIni.read("setting", "web_url");
                openServerName          = lib.pIni.read("setting", "web_name");
                openServerPassword      = rw.openServerPassword();
                openServerAgreed        = lib.pIni.read("setting", "web_agreed");
                openServerWebSocketIp   = lib.pIni.read("setting", "web_socket_ip");
                openServerWebSocketPort = lib.pIni.read("setting", "web_socket_port");
                openServerWebForce      = lib.pIni.read("setting", "web_force");
                openServerUpdate        = pSetting.openServerUpdateRead();
                websocket = new lib.pUpdateServerSocket();
                userToken = lib.pApizlHttp.getToken();
                if (userToken.Length <= 0)
                {
                    MessageBox.Show("用户自动登录失败!" + lib.pApizlHttp.error, "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                return("");
            }
            catch (Exception ex)
            {
                pLogs.logs("config-error:" + ex.ToString());
                return(ex.ToString());
            }
        }
Example #2
0
        /// <summary>
        /// socket 保存
        /// </summary>
        /// <param name="ip"></param>
        /// <param name="port"></param>
        /// <param name="force"></param>
        public static void saveSocket(string ip, string port, CheckState force)
        {
            ConfigReadWrite rw = new ConfigReadWrite();

            rw.openServerWebSocketIp(ip);
            rw.openServerWebSocketPort(port);
            rw.openServerWebForce(force.ToString());
            //lib.pIni.write("setting", "web_socket_ip", ip);
            //lib.pIni.write("setting", "web_socket_port", port);
            //lib.pIni.write("setting", "web_force", force.ToString());
        }
Example #3
0
        /// <summary>
        /// 保存服务器信息
        /// </summary>
        /// <param name="url"></param>
        /// <param name="name"></param>
        /// <param name="password"></param>
        public static void saveUrlNamePassword(string url, string name, string password, CheckState c, CheckState agreed)
        {
            ConfigReadWrite rw = new ConfigReadWrite();

            rw.openServerUrl(url);
            rw.openServerName(name);
            rw.openServerPassword(password);
            //lib.pIni.write("setting", "web_url", url);
            //lib.pIni.write("setting", "web_name", name);
            //lib.pIni.write("setting", "web_password", password);
            lib.pIni.write("setting", "web_update", c.ToString());
            lib.pIni.write("setting", "web_agreed", agreed.ToString());
        }