public
string
GetMD5(
string
str)
{
byte [] b = System.Text.Encoding.Default.GetBytes(str);
b = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(b);
StringBuilder sb = new StringBuilder( 64 );
foreach ( byte bs in b)
{
sb.AppendFormat( " {0:X2} " , bs);
}
return sb.ToString();
}
WebForm:
{
byte [] b = System.Text.Encoding.Default.GetBytes(str);
b = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(b);
StringBuilder sb = new StringBuilder( 64 );
foreach ( byte bs in b)
{
sb.AppendFormat( " {0:X2} " , bs);
}
return sb.ToString();
}
public
string
GetMD5(
string
str)
{
return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Password, " MD5 " );
}
{
return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Password, " MD5 " );
}