日期:2014-05-17 浏览次数:20528 次
public static string MD5(string toCryString)
{
//MD5CryptoServiceProvider hashmd5;
//hashmd5 = new MD5CryptoServiceProvider();
//return BitConverter.ToString(hashmd5.ComputeHash(Encoding.Default.GetBytes(toCryString))).Replace("-", "");
byte[] result = Encoding.Default.GetBytes(toCryString);
MD5 md5 = new MD5CryptoServiceProvider();
byte[] output = md5.ComputeHash(result);
return BitConverter.ToString(output).Replace("-", "");
}