标签:encoding nbsp length using com efault log ret code
今天试着写了一下MD5加密,网站注册登录估计都用到MD5,今天就把写的贴出来
public string GetMd5(string user) { using (MD5 md5 = MD5.Create()) { byte[] msgbyte = Encoding.Default.GetBytes(user); byte[] md5byte = md5.ComputeHash(msgbyte); md5.Clear(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < md5byte.Length; i++) { sb.Append(md5byte[i].ToString("x2")); } return sb.ToString(); } }
标签:encoding nbsp length using com efault log ret code
原文地址:http://www.cnblogs.com/ZyCoder/p/6143003.html