[求助]登陆验证问题
我现在如果密码为111111,就能进去,如果密码换成123456或别的就进不去,这是为什么啊?
数据库密码列的类型是varchar
try
{
if (dr.Read())
{
if (dr.GetString(0)==txtUserName.Text && dr.GetString(1) == txtUserPass.Text.Trim() )
{
Response.Redirect("~/back/AddEpUser.aspx");
}
else
{
Response.Write("<script>alert('用户密码不正确!')</script>");
}
}
else
{
Response.Write("<script>alert('无此用户!')</script>");
}
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
finally
{
dr.Close();
}