Exemplo n.º 1
0
        private void _Login(object state)
        {
            string computerName = Dns.GetHostName();              //本机名
            string mac          = LocalVariable.GetComputerMac(); //计算机MAC

            string errMsg = string.Empty;

            try
            {
                errMsg = DBHelper.LoginInput(this.userName, this.pwd, mac, computerName, Guid.NewGuid().ToString());
            }
            catch (TimeoutException)
            {
                errMsg = "现在服务器正在维护,我们的工程师正在抢修,请稍候。";
                GlobalStaticObj.GlobalLogService.WriteLog("用户登录", "数据库连接超时异常,数据库连接字符串错误或者数据库宕机");
            }
            catch (Exception ex)
            {
                errMsg = "通讯异常!";
                GlobalStaticObj.GlobalLogService.WriteLog("用户登录", ex);
            }

            if (this.uiHandler != null)
            {
                this.Invoke(this.uiHandler, errMsg);
            }
        }
Exemplo n.º 2
0
        private void _Login(object state)
        {
            string computerName = Dns.GetHostName();              //本机名
            string mac          = LocalVariable.GetComputerMac(); //计算机MAC

            ////登录验证
            //GlobalStaticObj.CurrAccCode = this.dtDb.Select("Value='" + this.tbDb.Tag + "'")[0]["Code"].ToString();
            //执行存储过程
            string errMsg = DBHelper.LoginInput(this.userName, this.pwd, mac, computerName, Guid.NewGuid().ToString());

            if (this.uiHandler != null)
            {
                this.Invoke(this.uiHandler, errMsg);
            }
        }
Exemplo n.º 3
0
        private void _Login(object state)
        {
            string computerName = Dns.GetHostName();              //本机名
            string mac          = LocalVariable.GetComputerMac(); //计算机MAC

            string errMsg = string.Empty;

            try
            {
                errMsg = DBHelper.LoginInput(this.userName, this.pwd, mac, computerName, Guid.NewGuid().ToString());
            }
            catch
            {
                errMsg = "通讯异常!";
            }

            if (this.uiHandler != null)
            {
                this.Invoke(this.uiHandler, errMsg);
            }
        }