c# MD5加密
c#实现md5加密,最后转换成小写的32位的小写密码
引用:using System.Security.Cryptography;
//md5 加密 byte[] result = Encoding.Default.GetBytes("admin123456"); MD5 md5 = new MD5CryptoServiceProvider(); byte[] output = md5.ComputeHash(result); string str = BitConverter.ToString(output).Replace("-", "").ToLower();
也可
return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile( user.ToString().Trim() + pwd.Trim(), "md5");