• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
无忧岛主
实践是检验真理的唯一标准
博客园    首页    新随笔       管理    订阅  订阅
Request的RawUrl属性,和其它获取url信息的各种方法比较
转载:http://hi.baidu.com/anyedage/blog/item/e8c45ed3b90d25023af3cf26.html
 
Request的RawUrl属性,和其它获取url信息的各种方法比较
2006-08-31 13:58

RawUrl 属性

属性值

当前请求的原始 URL。

备注

原始 URL 定义为 URL 中域信息之后的部分。在 URL 字符串 http://www.contoso.com/articles/recent.aspx 中,原始 URL 为/articles/recent.aspx。原始 URL 包括查询字符串(如果存在)。

测试的url地址是http://www.test.com/testweb/default.aspx?id=1, 结果如下:



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?id=1

Request.Url.AbsolutePath: /testweb/default.aspx

Request.Url.AbsoluteUri: http://www.test.com/testweb/default.aspx?id=1

Request.Url.Host: www.test.com

Request.Url.LocalPath: /testweb/default.aspx



             Response.Write("<b>Request.ApplicationPath:</b> "+ Request.ApplicationPath +"<br>");

             Response.Write(
"<b>Request.CurrentExecutionFilePath:</b> "+ Request.CurrentExecutionFilePath +"<br>");

             Response.Write(
"<b>Request.FilePath:</b> "+ Request.FilePath +"<br>");

             Response.Write(
"<b>Request.Path:</b> "+ Request.Path +"<br>");

             Response.Write(
"<b>Request.PathInfo:</b> "+ Request.PathInfo +"<br>");

             Response.Write(
"<b>Request.PhysicalApplicationPath:</b> "+ Request.PhysicalApplicationPath +"<br>");

             Response.Write(
"<b>Request.PhysicalPath:</b> "+ Request.PhysicalPath +"<br>");

             Response.Write(
"<b>Request.RawUrl:</b> "+ Request.RawUrl +"<br>");

             Response.Write(
"<b>Request.Url.AbsolutePath:</b> "+ Request.Url.AbsolutePath +"<br>");

             Response.Write(
"<b>Request.Url.AbsoluteUri:</b> "+ Request.Url.AbsoluteUri +"<br>");

             Response.Write(
"<b>Request.Url.Host:</b> "+ Request.Url.Host +"<br>");

             Response.Write(
"<b>Request.Url.LocalPath:</b> "+ Request.Url.LocalPath +"<br>");

如果本文引用了你的文章而未注明,请及时联系我。
posted on 2012-07-05 15:19  无忧岛主  阅读(131)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3