private void button1_Click(object sender, EventArgs e)
{
string str = String.Format("F_ID='{0}'", textBox1.Text);
DataRow[] dr = dataSet11.user.Select(str);
if (dr.Length > 0)
{
if (dr[0]["F_PassWord"].ToString() == textBox2.Text)
{
Form2 f2 = new Form2();
f2.Show();
}
else
{
MessageBox.Show("密码输入错误!");
}
}
else
{
MessageBox.Show("你输入的用户名错误!");
} }
{
string str = String.Format("F_ID='{0}'", textBox1.Text);
DataRow[] dr = dataSet11.user.Select(str);
if (dr.Length > 0)
{
if (dr[0]["F_PassWord"].ToString() == textBox2.Text)
{
Form2 f2 = new Form2();
f2.Show();
}
else
{
MessageBox.Show("密码输入错误!");
}
}
else
{
MessageBox.Show("你输入的用户名错误!");
} }
string strPwd = 加密算法函数(textBox2.Text);if (dr[0]["F_PassWord"].ToString() ==strPwd)
{
Form2 f2 = new Form2();
f2.Show();
}
这里判断下两个字符串的值,用TextBOx显示下不就知道是什么原因了。~~~~~~~
要是相等的话,理论上是可以进去啊。有没有其他错误导致运行不正常,rebuild一下试试咯。
问题就解决了…………