C#帮助类:MD5加密

2021-06-21 22:06

阅读:556

标签:orm   ica   sys   substring   word   returns   password   encrypt   empty   

 1     /// 
 2     /// MD5加密
 3     /// 
 4     public class Md5
 5     {
 6         /// 
 7         /// MD5加密
 8         /// 
 9         /// 加密字符
10         /// 加密位数16/32
11         /// 
12         public static string md5(string str, int code)
13         {
14             string strEncrypt = string.Empty;
15             if (code == 16)
16             {
17                 strEncrypt = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").Substring(8, 16);
18             }
19 
20             if (code == 32)
21             {
22                 strEncrypt = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");
23             }
24 
25             return strEncrypt;
26         }
27     }

 

C#帮助类:MD5加密

标签:orm   ica   sys   substring   word   returns   password   encrypt   empty   

原文地址:https://www.cnblogs.com/qinyi173/p/10222909.html


评论


亲,登录后才可以留言!