private void button1_Click(object sender, EventArgs e)
{//登录按钮
//BLLuserinformation userinformation = new BLLuserinformation();
Datalinq .user_information obj=new user_information ();
if (!(textBox1.Text == obj.userID && textBox2.Text == obj.passward))
{
MessageBox .Show ("请先注册!!!");
}
else if (textBox1 .Text ==obj .userID && textBox2 .Text ==obj .passward )
{
Form1 frm = new Form1();
frm.Show();
Form3 frm3 = new Form3();
frm3.Close();
}
else if (textBox1.Text == "" || textBox2.Text == "")
{
MessageBox.Show("密码或账号不能为空");
}
为什么调试的时候总是弹出“请先注册”窗口,无论是密码是正确还是错误或是密码或用户名为空,总是出现“请先注册窗口”,郁闷死了。。请指点一二。
{//登录按钮
//BLLuserinformation userinformation = new BLLuserinformation();
Datalinq .user_information obj=new user_information ();
if (!(textBox1.Text == obj.userID && textBox2.Text == obj.passward))
{
MessageBox .Show ("请先注册!!!");
}
else if (textBox1 .Text ==obj .userID && textBox2 .Text ==obj .passward )
{
Form1 frm = new Form1();
frm.Show();
Form3 frm3 = new Form3();
frm3.Close();
}
else if (textBox1.Text == "" || textBox2.Text == "")
{
MessageBox.Show("密码或账号不能为空");
}
为什么调试的时候总是弹出“请先注册”窗口,无论是密码是正确还是错误或是密码或用户名为空,总是出现“请先注册窗口”,郁闷死了。。请指点一二。
if (!(textBox1.Text == obj.userID && textBox2.Text == obj.passward))//所以每次都为false
{
obj=bll.getmodel(userID);
}
{
MessageBox .Show ("textBox1.Text="+textBox1.Text+“,obj.userID=”+obj.userID);
MessageBox .Show ("textBox2.Text="+textBox2.Text+“,obj.passward=”+obj.passward); MessageBox .Show ("请先注册!!!");
}搂住,你先看看他们的值是怎么样的再说。
+1断点跟踪下,看看obj有没有赋值吧