加密数据
//加密数据,以SHA1/MD5两种方法
public static string GetEncrypt(string strData, string strType)
{
if (strType.ToUpper() == "SHA1")
{
strData = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strData, "sha1");
}
else if (strType.ToUpper() == "MD5")
{
strData = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strData, "md5");
}
return strData;
}
调用
string Password;
Password = Pulic.GetEncrypt(Password, "MD5");

浙公网安备 33010602011771号