C#中将字符串转换为MD5
private string getMd5(string password)
{
byte[] pasArray = System.Text.Encoding.Default.GetBytes(password);
pasArray = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(pasArray);
string rMd5Str = "";
foreach(byte ibyte in pasArray)
rMd5Str += ibyte.ToString("x").PadLeft(2, '0');
return rMd5Str;
}
{
byte[] pasArray = System.Text.Encoding.Default.GetBytes(password);
pasArray = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(pasArray);
string rMd5Str = "";
foreach(byte ibyte in pasArray)
rMd5Str += ibyte.ToString("x").PadLeft(2, '0');
return rMd5Str;
}