using System.Security.Cryptography;
public static string MD5Encrypt(string str)
{
string cl = str;
string pwd = "";
MD5 myMd5 = MD5.Create();
byte[] bytes = myMd5.ComputeHash(Encoding.UTF8.GetBytes(cl));
for (int i = 0; i < bytes.Length; ++i)
{
pwd = pwd += bytes[i].ToString("x2");
}
return pwd;
}