asp.net中MD5 16位和32位加密函数
更新时间:2007年03月21日 00:00:00 作者:
public string md5(string str,int code)
{
if(code==16) //16位MD5加密(取32位加密的9~25字符)
{
return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5").ToLower().Substring(8,16) ;
}
else//32位加密
{
return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5").ToLower();
}
}
{
if(code==16) //16位MD5加密(取32位加密的9~25字符)
{
return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5").ToLower().Substring(8,16) ;
}
else//32位加密
{
return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5").ToLower();
}
}
相关文章
Coolite Cool Study 1 在Grid中用ComboBox 来编辑数据
作为Coolite的第一个教程,我想展现给大家能够体现Coolite强大的例子(当然也比官方例子稍微复杂一点)。2009-05-05
Visual Studio ASP.NET Core MVC入门教程第一篇
这篇文章主要为大家详细介绍了Visual Studio ASP.NET Core MVC入门教程的第一篇,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2017-03-03
asp.net Reporting Service在Web Application中的应用
由于我们这个项目中使用微软的报表服务(Reporting Services)作为报表输出工具,本人也对它进行一点点研究,虽没有入木三分,但这点知识至少可以在大部分Reporting Service的场景中应用。2008-11-11


最新评论