string HmacMD5(string source, string key)
{
HMACMD5 hmacmd = new HMACMD5(Encoding.Default.GetBytes(key));
byte[] inArray = hmacmd.ComputeHash(Encoding.Default.GetBytes(source));
StringBuilder sb = new StringBuilder(); for (int i = ; i < inArray.Length; i++)
{
sb.Append(inArray[i].ToString("X2"));
} hmacmd.Clear(); return sb.ToString();
}
需 引用命令空间System.Security.Cryptography