MD5加密和SHA1加密

引入命名空间using System.Web.Security;
public string EncryptStr(string PWD, int Format)
        {
            string str = "";
            switch (Format)
            {
                case 0:

                    str = FormsAuthentication.HashPasswordForStoringInConfigFile(PWD, "SHA1");
                    break;
                case 1:
                    str = FormsAuthentication.HashPasswordForStoringInConfigFile(PWD, "MD5");
                    break;
            }
            return str;
        }

这两种加密方式无解密方法,SHA1加密要更长一些

 

posted on   ミ咯咯①笑。  阅读(168)  评论(0编辑  收藏  举报

< 2009年7月 >
28 29 30 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8

导航

统计

点击右上角即可分享
微信分享提示