如果要使用MD5加密话必须引入名称空间using .Web.Security;
//加密,以下被选红字体就是C#提供加密思路方法
empPwd = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPwd.Text,"MD5"); //内容MD5加密
//验证用户输入密码是否和注册时样必须先将用户输入内容MD5加密再和数据库里内容进行判断看是否致
strSql="select * from employee where id=" + DropDownList1.SelectedValue + " and password='"+FormsAuthentication.HashPasswordForStoringInConfigFile(txtValidatePwd.Text.Trim,"MD5")+"'";
最新评论