本文共 326 字,大约阅读时间需要 1 分钟。
using System.Security.Cryptography;public static string MD5Encrypt(string str){ string cl = str; string pwd = ""; MD5 myMd5 = MD5.Create(); byte[] bytes = myMd5.ComputeHash(Encoding.UTF8.GetBytes(cl)); for (int i = 0; i < bytes.Length; ++i) { pwd = pwd += bytes[i].ToString("x2"); } return pwd;}
转载地址:http://hrzvf.baihongyu.com/