/// <summary> /// 加密 /// </summary> /// <param name="input">加密字符串</param> /// <param name="input_charset">编码</param> /// <returns></returns> public static string GetMD5(string input, string input_charset) { MD5 mD5 = new MD5CryptoServiceProvider(); byte[] t = mD5.ComputeHash(Encoding.GetEncoding(input_charset).GetBytes(input)); StringBuilder str = new StringBuilder(); for (int i = 0; i < t.Length; i++) { str.Append(t[i].ToString("x")); } return str.ToString(); }