方法如下:
/// <summary>
/// 遍历Url中的参数列表
/// </summary>
/// <returns>如:(?userName=keleyi&userType=1)</returns>
public string GetUrlParam()
{
string urlParam = "";
if (Request.QueryString.Count > )
{
urlParam = "?";
NameValueCollection keyVals = Request.QueryString;
foreach (string key in keyVals.Keys)
{
urlParam += key + "=" + keyVals[key] + "&";
}
urlParam = urlParam.Substring(, urlParam.LastIndexOf('&'));
}
return urlParam;
}