![]() |
#2
party6202013-07-02 11:43
|
protected void Button1_Click(object sender, EventArgs e)
{
String Md5_User_Pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(this.txt_User_Pwd.Text.ToString(), "MD5");
SqlStr = "select * from 管理员表 where 用户名='" + this.txt_User_Name.Text + "' and 密码='" + Md5_User_Pwd + "'";
Ds = db.GetDataTableBySql(SqlStr);
try
{
if (Ds.Tables[0].Rows.Count == 0)
{
this.Labinfo.Text = "用户名或密码错误,请重试!";
this.txt_User_Name.Focus();
}
else
{
this.Labinfo.Text = "管理员 " + this.txt_User_Name.Text + " 恭喜您登录成功!";
Session["Admin_UserName"] = this.txt_User_Name.Text;
}
}
catch (Exception)
{
this.Labinfo.Text = "没有得到任何数据,请重试!";
}
}