方法一:
System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
string s= BitConverter.ToString(md5.ComputeHash(System.Text.Encoding.Default.GetBytes("要加密的字符串"))).Replace("-","");
方法二:
引用:System.Management
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("要加密的字符串", "MD5");
System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
string s= BitConverter.ToString(md5.ComputeHash(System.Text.Encoding.Default.GetBytes("要加密的字符串"))).Replace("-","");
方法二:
引用:System.Management
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("要加密的字符串", "MD5");