在注册时进行MD5加密以后
在登入的时候怎么读取?
怎么进行比较??
在登入的时候怎么读取?
怎么进行比较??
解决方案 »
- repeater中linkbutton 下载 页面错误
- asp.net windows form,怎麼判斷某一個程序是否在運行
- 为什么Image控件的ImageUrl属性关联到了图片地址,但不能显示图片
- 怎么获取字符串里的第N个字符?
- 这个背景怎么做`啊``` 不是图片吧````````
- 怎样用程序设置iis的各项内容
- 求用ASP.netWEB页面实现套打的实现思路
- 绑定了一个bit字段,现在我要在后台操作这个字段的值,public bool IsOver(?) bool ,int都不对,应该是什么类型的变量?
- gridview中怎么在模板加入table控件(怎么分行与列)?
- 关于判断时间超出的问题
- 求ASP.NET注册时加密密码到数据的代码
- 高手请作答“SQL语句取出前三个要按时间排序且要在一个num字段取出数字不能相同的结果”
获取数据到SqlDataReader
if(dr["password"].ToString().Equals(FormsAuthentication.HashPasswordForStoringInConfigFile("", "MD5"))
{
}
为什么没反应的啊。。你写的那个代码好像也没反应我这么写的 不过也没反应
string getUname = this.TextBoxUname.Text.Trim();
string getPwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.TextBoxPwd.Text.Trim(), "MD5");
string selectSql = "select Uname,Pwd from UserLogin where Uname='" + getUname + "'and Pwd='" + getPwd + "'";
SqlCommand com = new SqlCommand(selectSql, con);
SqlDataAdapter da = new SqlDataAdapter (com);
DataTable table = new DataTable ();
for(int i=0;i<table.Rows.Count;i++)
{
if (Convert.ToString(table.Rows[i][0]).Equals(getUname) && Convert.ToString(table.Rows[i][1]).Equals(getPwd))
{
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "b", "alert('成功登入 ')", true);
}
else
{
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "b", "alert('用户名或密码错误 请检查!')", true);
con.Close();
}