1 using System.Security.Cryptography;
2 //Md5 [32位] 加密
3 MD5 md5 = MD5.Create();
4 byte [] md5Bytes = md5.ComputeHash(System.Text.Encoding.GetEncoding("GB2312").GetBytes(text));
5 string result = string.Empty;
6 foreach(byte val in md5Bytes)
7 {
8 result += val.ToString("X2");
9 }