public static string EncrptString(string str) { byte[] buffer = System.Text.Encoding.Default.GetBytes(str); MD5 md5 = MD5.Create(); buffer = md5.ComputeHash(buffer); StringBuilder sb = new StringBuilder(); foreach (var i in buffer) { sb.Append(i.ToString("x2")); } return sb.ToString(); }