public static CreateLinkStringUrlencode ( string>.Dictionary |
||
dicArray | string>.Dictionary | |
code | 字符编码 | |
리턴 | string |
/// <summary> /// 生成要请求给支付宝的参数数组 /// </summary> /// <param name="sParaTemp">请求前的参数数组</param> /// <param name="code">字符编码</param> /// <returns>要请求的参数数组字符串</returns> private static string BuildRequestParaToString(SortedDictionary <string, string> sParaTemp, Encoding code) { //待签名请求参数数组 Dictionary <string, string> sPara = new Dictionary <string, string>(); sPara = BuildRequestPara(sParaTemp); //把参数组中所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串,并对参数值做urlencode string strRequestData = Core.CreateLinkStringUrlencode(sPara, code); return(strRequestData); }
/// <summary> /// 生成要请求给支付宝的参数数组 /// Generate a set of parameters need in the request of Alipay /// </summary> /// <param name="sParaTemp">请求前的参数数组Pre-sign string</param> /// <param name="code">字符编码charset</param> /// <returns>要请求的参数数组字符串string need to be in the request</returns> private static string BuildRequestParaToString(SortedDictionary <string, string> sParaTemp, Encoding code) { //待签名请求参数数组 //params to be signed Dictionary <string, string> sPara = new Dictionary <string, string>(); sPara = BuildRequestPara(sParaTemp); //把参数组中所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串,并对参数值做urlencode //connect the parameters with "&" like "parameter=value",and do urlencode to the value string strRequestData = Core.CreateLinkStringUrlencode(sPara, code); return(strRequestData); }