using System.Security.Cryptography;
public string GetStrMD5Code(string Srcstr)
{
MD5CryptoServiceProvider md5csp = new MD5CryptoServiceProvider();
byte[] SrcBytes = Encoding.Default.GetBytes(Srcstr);
byte[] MD5Bytes = md5csp.ComputeHash(SrcBytes);
string MD5Code = BitConverter.ToString(MD5Bytes);
MD5Code = MD5Code.Replace("-","");//替换MD5中的“-”
return MD5Code;
}