Code
string str = "admin1235"; //要加密的字元串
System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] bytStr = md5.ComputeHash(Encoding.UTF8.GetBytes(str));
string encryptStr = "";
for (int i = 0; i < bytStr.Length; i++)
{
encryptStr = encryptStr + bytStr[i].ToString("x").PadLeft(2, '0');
}
MessageBox.Show(encryptStr);
轉載于:https://www.cnblogs.com/dongqiliang/archive/2008/12/06/1349007.html