Request获取url信息的各种方法比较
2004-07-12 11:18
731 查看
在ASP.NET编程中经常需要用Request获取url的有关信息,Request中有多种方法获取url信息,但我经常忘了各种方法的具体作用,今天我就写了个测试程序,将各种方法得到的结果列出来,以后用时直接参考一下就行了。
测试的url地址是http://www.test.com/testweb/default.aspx, 结果如下:
Request.ApplicationPath: /testweb
Request.CurrentExecutionFilePath: /testweb/default.aspx
Request.FilePath: /testweb/default.aspx
Request.Path: /testweb/default.aspx
Request.PathInfo:
Request.PhysicalApplicationPath: E:\WWW\testweb\
Request.PhysicalPath: E:\WWW\testweb\default.aspx
Request.RawUrl: /testweb/default.aspx
Request.Url.AbsolutePath: /testweb/default.aspx
Request.Url.AbsoluteUri: http://www.test.com/testweb/default.aspx Request.Url.Host: www.test.com
Request.Url.LocalPath: /testweb/default.aspx
测试的url地址是http://www.test.com/testweb/default.aspx, 结果如下:
Request.ApplicationPath: /testweb
Request.CurrentExecutionFilePath: /testweb/default.aspx
Request.FilePath: /testweb/default.aspx
Request.Path: /testweb/default.aspx
Request.PathInfo:
Request.PhysicalApplicationPath: E:\WWW\testweb\
Request.PhysicalPath: E:\WWW\testweb\default.aspx
Request.RawUrl: /testweb/default.aspx
Request.Url.AbsolutePath: /testweb/default.aspx
Request.Url.AbsoluteUri: http://www.test.com/testweb/default.aspx Request.Url.Host: www.test.com
Request.Url.LocalPath: /testweb/default.aspx
相关文章推荐
- A 'C' Test: The 0x10 Best Questions for Would-be Embedded Programmers
- VARIANT 、_variant_t 与 COleVariant [2004年4月7日 17:38]
- 有谁还用QuickReport吗?
- C# or Java ,it's a question?
- 还原Drupal的Blog评论模式
- MSBuild Bloggers and Resources
- ClearQuest体系结构分析
- 做了一个petoolkit的gui版本,放几张图上来。
- 利用WebClient和WebRequest类获得网页源代码
- 为已存在的ATL工程改GUID和接口名
- 让PowerBuilder制作查询系统的界面更加酷
- to NGen or not to NGen, that is the question
- How to build Web Part
- 一个人力资源系统的UI设计稿
- jfcUnit: 测试Java GUI Swing
- Beta is beta - Compatibility issue of VSIP 2005 beta1
- 构建高效软件开发流程和团队
- 先放个需求 Problem Statement (Requirment)
- php-gtk做GUI程序
- 我也quiz一把