//创建一个MD5加密字符类
View Code
//MD5 public class DESEncrypt { public static string Encrypt(string strText) { byte [] data=System.Text.Encoding.Unicode.GetBytes (strText.toCharArray()); System.Security.Cryptography.MD5 MD5=NEW System.Security.CryptoServiceProvider(); byte [] result=MD5.ComputeHash(data); string sResult=System.Text.Encoding.Uncode.Getstring(result); string EnPwd=System.Web.Security.FromAuthentication.HashpasswrodForStoring InConfig(strText.ToString(),"MD5"); RETURN EnPwd; } }