创建一个MD5加密字符类
//创建一个MD5加密字符类
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
//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; } }
所有问题都会有一定程度的抽象和假设