收藏本页 | 网站地图 | 投稿指南
 
 
当前位置:首页 >> 学院首页 >> 程序开发 >> .NET >>

.Net中的MD5加密-16位32位

放大字体  缩小字体  At: 2005-10-04 02:12  By: master8 转载 来源: 互联网
c#示例
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();
 } 
}
 






         









 
Google
论坛精华  
 
 
  ©2005-2008 站长吧 Master8.NET All Rights Reserved 陕ICP备05010609号