把写内容过程中经常用到的内容段珍藏起来,下面的资料是关于C# 读取QueryString全部数据并输出的内容。
using System.Collections;
using System.Collections.Specialized;
…
NameValueCollection collection = Request.QueryString;
String[] keyArray = collection.AllKeys;
Response.Write(“Keys:”);
foreach (string key in keyArray) {
Response.Write("
" + key +": “);
String[] valuesArray = collection.GetValues(key);
foreach (string myvalue in valuesArray) {
Response.Write(”""+myvalue + “” ");
}
}