Ejemplo n.º 1
0
        private void button_OK_Click(object sender, EventArgs e)
        {
            string text = this.textBox1.Text;

            if (this.encrypted)
            {
                text = SystemTool.MD5Encode(text);
            }
            if (text == this.oldPassword)
            {
                this.result = true;
                base.Dispose();
                return;
            }
            this.LblPasswordIsCorrect.Visible = true;
            this.textBox1.Text = "";
            this.result        = false;
        }
Ejemplo n.º 2
0
 private void formCloudLogin_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.isCountdowning)
     {
         this.isCountdowning = false;
         Thread.Sleep(1000);
     }
     if (base.DialogResult == DialogResult.OK)
     {
         Settings.Default.CloudServerRememberUser = this.chbCookie.Checked;
         Settings.Default.CloudServerUserName     = this.txtLoginName.Text;
         string text = this.txtPassword.Text;
         if (!this.isCookie)
         {
             text = SystemTool.MD5Encode(text);
         }
         Settings.Default.CloudServerPassword = text;
         Settings.Default.Save();
     }
 }
Ejemplo n.º 3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            AccountInfo accountInfo;

            if (this.mode == 1)
            {
                string text = this.txtLoginName.Text;
                if (string.IsNullOrEmpty(text))
                {
                    this.txtLoginName.Focus();
                    return;
                }
                string text2 = this.txtPassword.Text;
                if (string.IsNullOrEmpty(text2))
                {
                    this.txtPassword.Focus();
                    return;
                }
                if (!this.isCookie)
                {
                    text2 = SystemTool.MD5Encode(text2);
                }
                accountInfo = new AccountService().Login(text, text2);
                if (this.loginTimes >= 2)
                {
                    base.Close();
                }
                if (accountInfo == null)
                {
                    this.ShowMessage(formMain.ML.GetStr("Message_LoginName_Or_Password_Error"));
                    this.loginTimes++;
                    return;
                }
            }
            else
            {
                string text3 = this.txtMobile.Text;
                if (string.IsNullOrEmpty(text3))
                {
                    this.txtMobile.Focus();
                    return;
                }
                string text4 = this.txtSecurityCode.Text;
                if (string.IsNullOrEmpty(text4))
                {
                    this.txtSecurityCode.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(this.sessionIDMobileLogin))
                {
                    this.txtSecurityCode.Text = string.Empty;
                    this.txtSecurityCode.Focus();
                    return;
                }
                accountInfo = new AccountService().MobileLogin(text3, text4, this.sessionIDMobileLogin);
                if (this.loginTimes >= 2)
                {
                    base.Close();
                }
                if (accountInfo == null)
                {
                    this.ShowMessage(formMain.ML.GetStr("Message_Mobile_Or_SecurityCode_Error"));
                    this.loginTimes++;
                    return;
                }
            }
            if (LedGlobal.CloudAccount == null)
            {
                LedGlobal.CloudAccount = new LedAccount();
            }
            LedGlobal.CloudAccount.SetAccount(accountInfo);
            base.DialogResult = DialogResult.OK;
            base.Close();
        }