Request对象
Request对象用于检索从浏览器向服务器所发送的请求信息。它提供对当前页请求的访问,包括标题,Cookie,客户端证书等等。它也与HTTP协议的请求消息对应。
Request对象常用属性
属性 | |
applicationPath | 获取服务器上ASP.NET虚拟应用程序的根目录路径 |
Browser | 获取或者设置有关在请求的客户端浏览器的功能信息 |
ContertLength | 指定客户端发送的内容长度 |
Cookies | 获取客户端发送的Cookie集合 |
FilePath | 获取当前请求的虚拟路径 |
Files | 获取采用多部分MIME格式的由客户端上载的文件集合 |
Form | 获取窗体变量集合 |
Item | 从Cookies, From, QueryString或ServerVariables集合中获取指定的对象 |
Params | 获取QueryString,Form,ServerVariables和Coockies项的组合集合 |
Path | 获取当前请求的虚拟路径 |
QueryString | 获取HTTP查询字符串变量集合 |
UserHostAddress | 获取远程客户端ip主机地址 |
UserHostName | 获取远程客户端DNS名称 |
Request常用方法
方法 | |
MapPath | 将请求的URL中的虚拟路径映射到服务器上的物理路径 |
SaceAs | 将HTTP请求保存到磁盘 |
1.获取页面间传送的值
Request对象只要通过Params属性和QueryString属性获取页面间的传值。
下面继续上个简单的实验例子试试,我新建立一个RequestO.aspx页面,该页面就负责把信息传递给目标页面,所以放一个按钮简单演示下,代码如下:
QQJu+KjH32TIiaXL9+6tXygV3IrcPafQRy/kKN8I00LuiiaDFSy1JD4ubbVQ+ehUtVBPZmae7+uvO5Gw1cK1te/Ztn3u3Fvk23Pn3rJte23te5GuLk0z86M3C3/xw/Ba+Ov6H1qbd37t7vqt5Q7lVG5kg04bDzapufFfq1rI3/kPd9sf5/nW/vAg/9M/qkax/tbyDiXlBppSjRRbpg+NXYIcmb/zH9QzVdVRuc+eZsNpofLrIGbo64RGLZxb+cj+aGXO3XVmnQ3lVGxkg06Pf/cjam7816oWjrNBqzdf51v76LvHX7+pGsV6Zt07lJQbaEo1UmyZPjR2CXLk8ZWPqGf2ojqKIAiCIEiysm/fwX37VNVC8pmYFOKISnH6p4tZC33Gl5auiJcQbiBkNxw6Xifsot1jxUBNtXCkdM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