MD5加密

 

 1public static string ConvertMD5(string str)
 2{
 3byte[] b=System.Text.Encoding.Default.GetBytes(str);
 4b=new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(b);
 5StringBuilder sb = new StringBuilder();
 6for(int i=0;i<b.Length;i++)
 7sb.AppenD(b[i].ToString ("x").PadLeft(2,'0'));
 8return sb.ToString();
 9}
 
10
posted @ 2005-07-13 15:58  Vincent  阅读(1224)  评论(2编辑  收藏  举报