CreateLinkStringUrlencode() 공개 정적인 메소드

把数组所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串,并对参数值做urlencode
public static CreateLinkStringUrlencode ( string>.Dictionary dicArray, Encoding code ) : string
dicArray string>.Dictionary
code System.Text.Encoding 字符编码
리턴 string
예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }