Exemplo n.º 1
0
        private bool getServerList(string data, ref serverUser server, ref Socket socket)
        {
            try
            {
                /* AppConfig */
                AppConfigClass AppConfig = new AppConfigClass();
                string         user      = AppConfig.GetConfig(ref data, "_"); //执行完毕后data为电脑名称
                if (user == "")
                {
                    return(false);
                }

                server.user = user;
                serverComputer b = new serverComputer()
                {
                    name = data, socket = socket
                };
                server.server.Add(b);
                return(true);
            }
            catch (Exception error)
            {
                new MessageClass().writeLog("Server::getServerList Error:" + error.Message);
                return(false);
            }
        }
Exemplo n.º 2
0
        public bool Sign_in(ref string data)   //ToKen(身份)验证
        /* AppConfig */
        {
            AppConfigClass AppConfig = new AppConfigClass();
            string         session   = AppConfig.GetConfig(ref data, "|");
            string         user;

            if (!Sign_in_w(session, out user))
            {
                return(false);
            }
            data = user + "_" + data;
            return(true);
        }
Exemplo n.º 3
0
        private bool getServerList(string data, ref ServerClass.serverUser server)
        {
            try
            {
                /* AppConfig */
                AppConfigClass AppConfig = new AppConfigClass();

                /* user */
                string user = AppConfig.GetConfig(ref data, "_");
                if (user == "")
                {
                    return(false);
                }
                server.user = user;

                /* shell */
                string ComputerName = AppConfig.GetConfig(ref data, "|"); //执行完毕后data为shell
                if (ComputerName == "")
                {
                    return(false);
                }
                ServerClass.serverComputer b = new ServerClass.serverComputer()
                {
                    name = ComputerName, data = data
                };

                /* Add List  */
                server.server.Add(b);
                return(true);
            }
            catch (Exception error)
            {
                new MessageClass().writeLog("Client::getServerList Error:" + error.Message);
                return(false);
            }
        }