HttpRequest.QueryString 属性
2008-06-27 17:25
302 查看
获取 HTTP 查询字符串变量集合。
命名空间:System.Web程序集:System.Web(在 system.web.dll 中)
public NameValueCollection QueryString { get; }
属性值
NameValueCollection,包含由客户端发送的查询字符串变量的集合。下面的代码示例接受来自客户端窗体(具有 GET 方法属性)的查询字符串,并写出窗体上每个命名输入元素的名称和值。将此代码放置在由窗体的 ACTION 属性 (Attribute) 引用的 ASP.NET 页上。
int loop1, loop2;
// Load NameValueCollection object.
NameValueCollection coll=Request.QueryString;
// Get names of all keys into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Key: " + Server.HtmlEncode(arr1[loop1]) + "<br>");
String[] arr2 = coll.GetValues(arr1[loop1]);
for (loop2 = 0; loop2 < arr2.Length; loop2++)
{
Response.Write("Value " + loop2 + ": " + Server.HtmlEncode(arr2[loop2]) + "<br>");
}
}
相关文章推荐
- HttpRequest.Item 属性 和 HttpRequest.QueryString 属性的区别!
- HttpContext.Current.Request.QueryString[ ]
- HttpServletRequest getQueryString();
- HttpContext.Current.Request.QueryString.AllKeys 返回的大小写, 飘忽不定。
- 【C#】关于HttpContext.Current.Request.QueryString 你要知道点
- 'System.Web.HttpRequest.QueryString' denotes a 'property' where a 'method
- httpServletRequest.getQueryString()返回null的异常 初学者错误
- 在servlet中GET请求可以通过HttpServletRequest的getRequestURL方法和getQueryString()得到完整的请求路径和请求所有参数列表,POST的需要getPa
- 在servlet中GET请求可以通过HttpServletRequest的getRequestURL方法和getQueryString()得到完整的请求路径和请求所有参数列表,POST的需要getPa
- 不能以方法的方式使用不可调用的“system.web.httprequest.querystring”
- 循环取值Request.QueryString的用法
- the method getcontextpath() from the type httpservletrequest refers to the missing type string
- asp.net中Request.QueryString与Request.Param的区别分析
- 使用 Request.QueryString 接受参数时,跟编码有关的一些问题
- Request.params、Request、Request.querystring、Request.Form 具体区别!
- Request.QueryString 接受参数时,跟编码有关的一些问题
- XMLHTTPRequest的属性和方法简介[转帖]
- XMLHttpRequest的方法和属性
- [PHP学习教程 - 网络]002.$_SERVER["SCRIPT_NAME"]、$_SERVER["PHP_SELF"]、$_SERVER["QUERY_STRING"]、$_SERVER["REQUEST_URI"]介绍($_SERVER URL Infomation)
- PHP获取当前url路径的函数及服务器变量:QUERY_STRING、REQUEST_URI、SCRIPT...