/// <summary> /// MD5签名 /// </summary> /// <param name="content"></param> /// <param name="key"></param> /// <returns></returns> public static String MD5Sign(String content, String key) { String signStr = ""; if ("" == key) { throw new Exception("财付通签名key不能为空!"); } if ("" == content) { throw new Exception("财付通签名内容不能为空"); } signStr = content + "&key=" + key; return(MD5Util.GetMD5(signStr).ToUpper()); }
/// <summary> /// 放重发 (生成32位随机串) /// </summary> /// <returns></returns> public static string CreateNoncestr() { return(MD5Util.GetMD5(new Random().Next(1000).ToString(), "utf-8")); }