private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "陈杰" && textBox2.Text == "123" || textBox1.Text == "何辉" && textBox2.Text == "456") { FrmStudent f = new FrmStudent(); f.Show(); this.Hide(); } else { MessageBox.Show("账号或密码错误"); } }
private void button1_Click(object sender, EventArgs e) { string name = this.textBox1.Text; string password = this.textBox2.Text; if (name.Equals("swpu") && password.Equals("123456")) { FrmStudent frm = new FrmStudent(); frm.Show(); this.Hide(); } else { MessageBox.Show("登录失败"); } }
private void Login_Click(object sender, EventArgs e) { string name = this.TBname.Text; string password = this.TBpwd.Text; if (name.Equals("黄老师") && password.Equals("123")) { FrmStudent frm = new FrmStudent(); frm.Show(); this.Hide(); } else { MessageBox.Show("用户名或密码错误"); } }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "黄本巍" && textBox2.Text == "123456") { MessageBox.Show("欢迎登录!", "提示"); this.Hide(); FrmStudent frmStudent = new FrmStudent(); frmStudent.Show(); } if (textBox1.Text == "付昶宇" && textBox2.Text == "123456") { MessageBox.Show("欢迎登录!", "提示"); this.Hide(); FrmStudent frmStudent = new FrmStudent(); frmStudent.Show(); } }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "王静宜" && textBox2.Text == "123456") { Console.WriteLine("登录成功!"); } if (textBox1.Text == "顾毓" && textBox2.Text == "123456") { Console.WriteLine("登录成功!"); } FrmStudent h = new FrmStudent(); h.Show(); }