其实在ASP.Net编程中,不用调用md5.asp来加密数据。在DotNet中有自带的类:
CUCC_oZb y<7"c\dV System.Web.Security.HashPasswordForStoringInConfigFile() 以下是引用片段:
\9xMWb(* public string md5(string str,int code)
g'QT[E {
`@!PSh if(code==16) //16位MD5加密(取32位加密的9~25字符)
#x[Hca {
Ea @S *%] return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5").ToLower().Substring(8,16) ;
iXYP*& }
z'8gdI5Pu if(code==32) //32位加密
ocuY6D {
{wSuc:N*} return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5").ToLower();
C&A Ut }
U"(p^I'z return "00000000000000000000000000000000";
>4psTT'rk }
查看本文来源