private void button1_Click(object sender, System.EventArgs e) { try { Lecturer u = new Lecturer(); u.L_NAME = this.comboBox1.Text.Trim(); u.L_PASS = this.textBox2.Text.Trim(); //判断用户是否进行了输入 if (IfInput(u.L_NAME, u.L_PASS)) { bool b = ub.ExistsUsers(u); if (b) { MainFrm main = new MainFrm(); Helper.L_NAME = comboBox1.Text; main.Show(); this.Visible = false; } else { MessageBox.Show("登陆失败"); } } } catch { } }
private void button1_Click(object sender, EventArgs e) { try { if (textBox1.Text.Trim() == null && textBox2.Text.Trim() == null) { MessageBox.Show("请输入原密码!"); } if (textBox2.Text.Trim() == null) { MessageBox.Show("请再次输入原密码"); } if (textBox1.Text.Trim() != textBox2.Text.Trim()) { MessageBox.Show("两次密码输入不一致,请检查后重新输入!"); } else if (textBox1.Text.Trim() == textBox2.Text.Trim()) { l.L_NAME = Helper.L_NAME; l.L_PASS = textBox1.Text.Trim(); bool flag = lb.ExistsUsers(l); if (flag) { button1.Enabled = false; label3.Show(); textBox3.Show(); button2.Show(); } else { MessageBox.Show("密码错误!"); } } } catch { } }