Request对象的使用
2007-05-16 14:51
337 查看
出自:http://www.51fy.cn/web/ASPNET/200705/33085.html
Response.Write("客户端的操作系统:" + Request.Browser.Platform + "<br>"); // WinNT
Response.Write("客户端用的浏览器:" + Request.Browser.Browser + "<br>"); // IE
Response.Write("客户端浏览器的版本:" + Request.Browser.Version + "<br>"); // 6.0
Response.Write("客户端FrameWork的版本:" + Request.Browser.ClrVersion.ToString()+"<br>"); // 2.0.50727
Response.Write("客户端浏览器是否有后退按钮:" + Request.Browser.HasBackButton.ToString()+"<br>"); // True
Response.Write("判断客户端浏览器类型:" + Request.Browser.IsBrowser("IE").ToString () + "<br>"); // True (大小写没差别)
Response.Write("判断客户端是几位机:" + ((Request.Browser.Win16==true)? "16位机":"32位机") + "<br>"); // 32位机
//Response.Write(""+Request.ContentEncoding.EncodingName+"<br>");
Response.Write("ApplicationPath应用程序根路径: " + Request.ApplicationPath + "<br>"); // /study1
Response.Write("AppRelativeCurrentExecutionFilePath应用程序根虚拟路径: " + Request.AppRelativeCurrentExecutionFilePath + "<br>"); // ~/Default.aspx
Response.Write("CurrentExecutionFilePath当前请求的虚拟路径: " + Request.CurrentExecutionFilePath + "<br>"); // /study1/textPath/path.aspx
Response.Write("AppDomain.CurrentDomain.BaseDirectory 获取基目录: " + AppDomain.CurrentDomain.BaseDirectory + "<br>"); // C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005
Response.Write("原始URL地址(包括URL的参数)Request.RawUrl" + Request.RawUrl+"<br>"); // /study1/Default3.aspx?type=dddd
Response.Write("物理文件路径PhysicalPath:" + Request.PhysicalPath + "<br>"); // C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005WebSitesstudy1Default3.aspx
Response.Write("应用程序根目录物理文件路径PhysicalApplicationPath:" + Request.PhysicalApplicationPath + "<br>"); // C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005WebSitesstudy1
Response.Write("程序集路径:AppDomain.CurrentDomain.RelativeSearchPath" + AppDomain.CurrentDomain.RelativeSearchPath + "<br>"); // C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005WebSitesstudy1in
Response.Write("虚拟路径对应的物理路径Server.MapPath " + Server.MapPath("Default3.aspx") + "<br>"); //C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005WebSitesstudy1Default3.aspx
Response.Write("获取绝对的URI:Request.Url.AbsoluteUri" + Request.Url.AbsoluteUri.ToString()+"<br>"); // http://localhost:1035/study1/Default3.aspx?type=dddd
Response.Write("获取主机名:端口号" + Request.Url.Authority + "<br>"); // localhost:1035
Request.SaveAs(Request.PhysicalApplicationPath + "abc.xml", true);//保存
Response.Write("客户端的操作系统:" + Request.Browser.Platform + "<br>"); // WinNT
Response.Write("客户端用的浏览器:" + Request.Browser.Browser + "<br>"); // IE
Response.Write("客户端浏览器的版本:" + Request.Browser.Version + "<br>"); // 6.0
Response.Write("客户端FrameWork的版本:" + Request.Browser.ClrVersion.ToString()+"<br>"); // 2.0.50727
Response.Write("客户端浏览器是否有后退按钮:" + Request.Browser.HasBackButton.ToString()+"<br>"); // True
Response.Write("判断客户端浏览器类型:" + Request.Browser.IsBrowser("IE").ToString () + "<br>"); // True (大小写没差别)
Response.Write("判断客户端是几位机:" + ((Request.Browser.Win16==true)? "16位机":"32位机") + "<br>"); // 32位机
//Response.Write(""+Request.ContentEncoding.EncodingName+"<br>");
Response.Write("ApplicationPath应用程序根路径: " + Request.ApplicationPath + "<br>"); // /study1
Response.Write("AppRelativeCurrentExecutionFilePath应用程序根虚拟路径: " + Request.AppRelativeCurrentExecutionFilePath + "<br>"); // ~/Default.aspx
Response.Write("CurrentExecutionFilePath当前请求的虚拟路径: " + Request.CurrentExecutionFilePath + "<br>"); // /study1/textPath/path.aspx
Response.Write("AppDomain.CurrentDomain.BaseDirectory 获取基目录: " + AppDomain.CurrentDomain.BaseDirectory + "<br>"); // C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005
Response.Write("原始URL地址(包括URL的参数)Request.RawUrl" + Request.RawUrl+"<br>"); // /study1/Default3.aspx?type=dddd
Response.Write("物理文件路径PhysicalPath:" + Request.PhysicalPath + "<br>"); // C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005WebSitesstudy1Default3.aspx
Response.Write("应用程序根目录物理文件路径PhysicalApplicationPath:" + Request.PhysicalApplicationPath + "<br>"); // C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005WebSitesstudy1
Response.Write("程序集路径:AppDomain.CurrentDomain.RelativeSearchPath" + AppDomain.CurrentDomain.RelativeSearchPath + "<br>"); // C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005WebSitesstudy1in
Response.Write("虚拟路径对应的物理路径Server.MapPath " + Server.MapPath("Default3.aspx") + "<br>"); //C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005WebSitesstudy1Default3.aspx
Response.Write("获取绝对的URI:Request.Url.AbsoluteUri" + Request.Url.AbsoluteUri.ToString()+"<br>"); // http://localhost:1035/study1/Default3.aspx?type=dddd
Response.Write("获取主机名:端口号" + Request.Url.Authority + "<br>"); // localhost:1035
Request.SaveAs(Request.PhysicalApplicationPath + "abc.xml", true);//保存
相关文章推荐
- Request对象的使用
- Request对象的使用
- 使用struts2上传文件时,使用timer拦截器,创建加载页面后,action内创建request对象,报(空指针异常)NullPointException
- JSP中request对象、session对象、Cookie对象的使用
- 使用request对象获取表单的信息
- 使用Request对象的Browser获取客户端浏览器的基本信息
- C++中使用IXMLHTTPRequest对象调用Web API时,对URL中的特殊字符(或中文)编码
- request对象的使用方法
- request对象的使用方法
- asp.net viewstate视图状态 from 表单Request对象 Response对象 原理跟使用
- 在request对象中,什么时候使用getAttribute()方法,什么时候使用getParameter()方法?
- Request对象的使用
- asp.net的Request对象使用方法
- 在非XXX.aspx.cs文件中使用Response、Request对象
- Web应用使用request对象
- JavaWeb使用request对象获取请求参数值
- Request对象使用经验谈(完善中....)
- 使用Request对象获取URL信息的各种方法
- JSP学习笔记(1) request对象和response对象使用场合
- java中request对象各种方法的使用实例分析