url、httprequest、request使用详解
来源:互联网 发布:进入数据库命令 编辑:程序博客网 时间:2024/06/05 19:14
设当前页完整地址是:http://www.jb51.net/aaa/bbb.aspx?id=5&name=kelli
c# 获取客户端ip,客户端操作系统,HttpRequest Request 详解:http://blog.csdn.net/pigkeli/article/details/9664981
"http://"是协议名
"www.jb51.net"是域名
"aaa"是站点名
"bbb.aspx"是页面名(文件名)
"id=5&name=kelli"是参数
【1】获取 完整url (协议名+域名+站点名+文件名+参数)
string url=Request.Url.ToString();
url= http://www.jb51.net/aaa/bbb.aspx?id=5&name=kelli
【2】获取 站点名+页面名+参数:
string url=Request.RawUrl;
(或 string url=Request.Url.PathAndQuery;)
url= /aaa/bbb.aspx?id=5&name=kelli
【3】获取 站点名+页面名:
string url=HttpContext.Current.Request.Url.AbsolutePath;
(或 string url= HttpContext.Current.Request.Path;)
url= aaa/bbb.aspx
【4】获取 域名:
string url=HttpContext.Current.Request.Url.Host;
url= www.jb51.net
【5】获取 参数:
string url= HttpContext.Current.Request.Url.Query;
url= ?id=5&name=kelli
Request.RawUrl:获取客户端请求的URL信息(不包括主机和端口)------>/Default2.aspx
Request.ApplicationPath:获取服务器上ASP.NET应用程序的虚拟路径。------>/
Request.CurrentExecutionFilePath
Request.Path:获取当前请求的虚拟路径。------>/Default2.aspx
Request.PathInfo:取具有URL扩展名的资源的附加路径信息------>
Request.PhysicalPath:获取与请求的URL相对应的物理文件系统路径。------>E:tempDefault2.aspx
Request.Url.LocalPath:------>/Default2.aspx
Request.Url.AbsoluteUri:------>http://localhost:8080/Default2.aspx
Request.Url.AbsolutePath:---------------------------->/Default2.aspx
- url、httprequest、request使用详解
- c# 获取客户端ip,客户端操作系统,HttpRequest Request 详解
- request详解之URL
- Django -- Request and HttpRequest
- 详解request.getRequestDispatcher(url).forword(request,response)
- Request.Path HttpRequest.ValidateInputIfRequiredByConfig() 异常
- HttpRequest对象属性详解
- ajax httprequest 详解
- 使用Android内置httpRequest发起httpRequest
- Request.UrlReferrer使用详解
- 在MB消息流中,如何使用ESQL来动态改变HTTPRequest的Web 服务URL?
- qml使用js-httprequest
- jsp 使用request获得url的方法
- Request.Url
- Request.Url
- URL Schemes 使用详解
- URL Schemes 使用详解
- HttpRequest
- JavaScript 操作 Cookie
- osal_start_system运行操作系统函数
- 9/29-10/6待字闺中面试题练习
- HDU 4768 Flyer(13年长春网络赛-J题-二分)
- 经验总结
- url、httprequest、request使用详解
- Linux内核系统定时器TIMER实现过程分析
- eclips 隐藏QuickAccess
- 遍历Map集合方式
- javascript 怎么获取文件上传对话框中的全路径名
- 最考验勇气办公室 处在2133米高空
- Linux内核常用数据结构——顺序表之哈希表
- 分享一款免费在线做图工具:ProcessOn
- 枚举排列问题:生成1-n的排列和可重集排列问题