求教 登陆条件解析
if((textBox1.Text=="")||(textBox2.Text=="")){
MessageBox.Show(this,"请从新输入用户名和密码!","信息提示",
MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
SqlConnection con=DB.CreateConn();
con.Open();
SqlCommand cmd=new SqlCommand("select count(*) from login where ID='"+textBox1.Text+"'",con);
int count1=Convert.ToInt32(cmd.ExecuteScalar());
if(count1<=0)
{
this.errorProvider1.SetError(this.textBox1,"用户名输入错误");
}
SqlCommand cmd1=new SqlCommand("select count(*) from login where pwd='"+textBox2.Text+"'",con);
int count2=Convert.ToInt32(cmd1.ExecuteScalar());
int count3=count1+count2;
if(count3<=count1||count3<=count2) {
this.errorProvider1.SetError(this.textBox2,"密码输入错误");
DialogResult drt=MessageBox.Show("用户名密码错误,是否重新输入?","提示信息",MessageBoxButtons.RetryCancel,MessageBoxIcon.Question);
switch(drt)
{
case DialogResult.Retry:
textBox1.Text="";
textBox2.Text="";
break;
case DialogResult.Cancel:
break;
}
请求高手能解释红色部分的意思!谢谢!