MD5加密
1
public static string ConvertMD5(string str)
2
{
3
byte[] b=System.Text.Encoding.Default.GetBytes(str);
4
b=new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(b);
5
StringBuilder sb = new StringBuilder();
6
for(int i=0;i<b.Length;i++){
7
sb.AppenD(b[i].ToString ("x").PadLeft(2,'0'));
8
return sb.ToString();
9
}
10
public static string ConvertMD5(string str)2
{3
byte[] b=System.Text.Encoding.Default.GetBytes(str);4
b=new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(b);5
StringBuilder sb = new StringBuilder();6
for(int i=0;i<b.Length;i++){ 7
sb.AppenD(b[i].ToString ("x").PadLeft(2,'0'));8
return sb.ToString();9
} 10





浙公网安备 33010602011771号