Asp.Net Request获取url信息的各种方法

在ASP.NET编程中经常需要用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



posted @ 2012-03-24 10:34  WebApi  阅读(535)  评论(0编辑  收藏  举报
CopyRight © 博客园 WebAPI