代码
string str = "";
int num = 0;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
num = Request.QueryString.Count;
sb.AppendLine("共有" + num.ToString() + "个参数<br/>");
foreach (string key in Request.QueryString.AllKeys)
{
sb.AppendLine(string.Format("Key={0} Value={1}<br/>", key, Request.QueryString[key]));
}
结果
共有2个参数<br/>
Key=toUserid Value=138<br/>
Key=comeUserid Value=659<br/>