//验证码刷新 private void SkinPictureBox1_Click(object sender, EventArgs e) { this.skinPictureBox1.Image = WBLogin.GetPIN(); }
//登录验证 private void OkButton_Click(object sender, EventArgs e) { //无验证码登录 if (!this.OkButton.Text.Equals("验证")) { if (this.UserNameBox.Text.Equals("") || this.PasswordBox.Text.Equals("")) { this.UserNameBox.BackColor = Color.Red; this.PasswordBox.BackColor = Color.Red; } else { this.UserNameBox.BackColor = Color.Transparent; this.PasswordBox.BackColor = Color.Transparent; this.StartLogin(); } } else { if (this.PinBox.Text.Equals("")) { this.PinBox.BackColor = Color.Red; } else { this.PinBox.BackColor = Color.Transparent; string result = WBLogin.End(this.PinBox.Text); if (result == "0") { if (WBLogin.DisplayName.IndexOf('<') > -1) { this.IsLocked = true; this.Close(); } else { //登录成功 this.ClosePage(); } } else if (result == "2070") { //验证码错误 this.skinPictureBox1.Image = WBLogin.GetPIN(); this.PinBox.Text = ""; this.PinBox.BackColor = Color.Red; } else if (result == "101&") { //密码错误 this.skinPanel1.Visible = false; this.PinBox.Text = ""; this.UserNameBox.BackColor = Color.Red; this.PasswordBox.BackColor = Color.Red; this.OkButton.Text = "确定"; this.UserNameBox.Enabled = true; this.PasswordBox.Enabled = true; this.CancelButton.Enabled = true; } else if (result == "4069") { MessageBox.Show("体验期已过,请验证邮箱", "提示"); } else { MessageBox.Show("未知错误", "提示"); } } } }