两种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");
posted @ 2009-06-10 22:07  随便取个名字算了  阅读(468)  评论(0编辑  收藏  举报