asp.net 中的MD5和SHA1加密

来源:百度知道 编辑:UC知道 时间:2024/05/31 06:33:05
在导入命名空间时找不到
System.Security.Cryptography.MD5
System.Security.Cryptography.MD5CryptoServiceProvider()
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strSource, "MD5")

System.Security.Cryptography.SHA1
System.Security.Cryptography.SHA1CryptoServiceProvider()
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strSource, "SHA1")
我用的是VS2005时不时VS2005没有这些命名空间?

不用导入
直接string xxx =System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(要转换的字符串,"MD5");
就可以了 。。

是你没添加引用,vs2005有