/*
将字符串转utf8 byte[]数组。
*/
public class MD5Helper { public static string Encrypt(string str) { string encryptStr = string.Empty; MD5 md5 = MD5.Create(); byte[] buffer = md5.ComputeHash(Encoding.UTF8.GetBytes(str)); foreach (var b in buffer) { encryptStr += b.ToString("X"); } return encryptStr; } }