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 }
posted on 2009-02-03 14:50  .Net Learning  阅读(531)  评论(0编辑  收藏  举报