DotText中使用的
public static string Encrypt(string password)
{
// Force the string to lower case
//
password = password.ToLower();

Byte[] clearBytes = new UnicodeEncoding().GetBytes(password);
Byte[] hashedBytes = ((HashAlgorithm) CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);

return BitConverter.ToString(hashedBytes);
}
Asp.net可用的
string strMd5En = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password.ToLower(),"MD5");
public static string Encrypt(string password)
{
// Force the string to lower case
//
password = password.ToLower();
Byte[] clearBytes = new UnicodeEncoding().GetBytes(password);
Byte[] hashedBytes = ((HashAlgorithm) CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
return BitConverter.ToString(hashedBytes);
}Asp.net可用的
string strMd5En = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password.ToLower(),"MD5");HashPasswordForStoringInConfigFile方法没有指定编码,应该是使用了Web.config的系统编码

浙公网安备 33010602011771号