返回顶部

收藏

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 + "\" ");
    }
 }

标签:querystring,key,C#

收藏

0人收藏

支持

0

反对

0