using System; using System.Collections.Generic; using System.Text; namespace MD5 { public class Util { public string getMD5(string WenBen) { try { StringBuilder sb = new StringBuilder(); foreach (byte b in System.Security.Cryptography.MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(WenBen))) { sb.Append(b.ToString("X2")); } return sb.ToString(); } catch (Exception ex) { return ex.Message; } } } }
时间: 2024-10-16 23:30:01