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