private void button1_Click(object sender, EventArgs e)
{
string uname = this.textBox1.Text.ToString();
string upassword = this.textBox2.Text.ToString();
SqlConnection thisconnection = new SqlConnection(@"Server=AL;Integrated Security=True;" + "DataBase=登陆界面");
thisconnection.Open();
SqlCommand thiscommand = thisconnection.CreateCommand();
= "select uname,upassword from yh where uname='" + uname + " '";
SqlDataReader thisreader = thiscommand.ExecuteReader();
if (thisreader.Read())
{
if (thisreader["upassword"].ToString().Trim() == upassword)
{
MessageBox.Show("恭喜您登陆成功!", "登陆成功!", MessageBoxButtons.OK, MessageBoxIcon.Information);
yhxx tt = new yhxx();
tt.Show();
}
else { MessageBox.Show("密码错误,请重新输入!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
else { MessageBox.Show("此用户不存在,请您注册!", "注册", MessageBoxButtons.OK, MessageBoxIcon.Information); }
thisconnection.Close();
thisreader.Close();
}
private void button2_Click(object sender, EventArgs e)
{
zhuce ss = new zhuce();
ss.Show();
}