现在的位置: 首页 > 综合 > 正文

asp.net–MD5加密

2012年10月08日 ⁄ 综合 ⁄ 共 347字 ⁄ 字号 评论关闭
//MD5加密
public static string GetMD5Code(string text)
{
    
byte[] inBytes = System.Text.Encoding.Default.GetBytes(text);
    System.Security.Cryptography.MD5CryptoServiceProvider md 
= new System.Security.Cryptography.MD5CryptoServiceProvider();
    
byte[] outBytes = md.ComputeHash(inBytes);
    
string s = BitConverter.ToString(outBytes);
    
return s;
}

抱歉!评论已关闭.