public String buildurlParam(Dictionary<String, String> param)
{
String paramStr = String.Empty;
if (param != null)
{
var dicSort = from objDic in param orderby objDic.Key select objDic;
foreach (var dic in dicSort)
{
string keyparam = dic.Value;
//keyparam = HttpUtility.UrlEncode(keyparam);
if (string.IsNullOrEmpty(paramStr))
{
paramStr += (dic.Key + "=" + keyparam);
}
else
{
paramStr += ("&" + dic.Key + "=" + keyparam);
}
}
}
return paramStr;
}
转换请求参数,拼接请求串
最新推荐文章于 2024-01-25 11:54:30 发布