Exemplo n.º 1
0
 private void DoLoginTemp()
 {
     if (string.IsNullOrEmpty(UserName) || string.IsNullOrEmpty(Password))
     {
         MessageBox.Show("请输入账号/密码!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
         return;
     }
     if (string.IsNullOrEmpty(AuthCode))
     {
         MessageBox.Show("请输入验证码!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
         return;
     }
     if (AuthCode.ToUpper() == validCode.ReturnCode.ToUpper())
     {
         scoketManager.Dispose();
         LoginBtnIsEnabled = false;
         if (!scoketManager.StartTradeSocket(true))
         {
             LoginBtnIsEnabled = true;
             ServerStatusInfoHelper.Instace().TradeServerStatus = string.Empty;
             MessageBox.Show("服务器无法连接,请检查服务器,重新登录!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
             return;
         }
         loginBll.SendLoginInfo(UserName, Password, MAC, IP);
     }
     else
     {
         AuthCode = string.Empty;
         CreateImageSource();
         MessageBox.Show("验证码输入有误,请检查后输入!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
     SetClientUsers(UserName);
 }