1.Request.applicationpath---Current application directory
2. Virtual directory corresponding to IISRequest.filepath
such as URL Http://mockte.com/1/index.html/pathinfo
FilePath =/1/index.html
3. Virtual path to the current request,Request.path
Path is the concatenation of the FilePath and PathInfo tails. For example URL Http://mockte.com/1/index.html/pathinfo
Then Path =/1/index.html/pathinfo
4.request.mappath (string url), map URLs to virtual directories on IIS
This directory is relative to the root directory of the application.
Does not contain a path like c:/, compared to Server.MapPath
Can be understood as a relative path (the Server.MapPath of the contrast is the absolute path)
5.server.mappath (string url), map the URL to a physical path on the server
For example http://mockte.com/1/index.html assume that your application is in C:/iis/mysite
So that's c:/iis/mysite/1/index.html.
6. The following table is the use of properties related to the URL of browser request
Website: Http://localhost:1897/News/Press/Content.aspx/123?id=1#toc |
Request.applicationpath |
/ |
Request.PhysicalPath |
D:/projects/solution/web/news/press/content.aspx |
System.IO.Path.GetDirectoryName (Request.PhysicalPath) |
D:/projects/solution/web/news/press |
Request.physicalapplicationpath |
d:/projects/solution/web/ |
System.IO.Path.GetFileName (Request.PhysicalPath) |
Content.aspx |
Request.currentexecutionfilepath |
/news/press/content.aspx |
Request.filepath |
/news/press/content.aspx |
Request.path |
/news/press/content.aspx/123 |
Request.rawurl |
/news/press/content.aspx/123?id=1 |
Request.Url.AbsolutePath |
/news/press/content.aspx/123 |
Request.Url.AbsoluteUri |
Http://localhost:1897/News/Press/Content.aspx/123?id=1 |
Request.Url.Scheme |
http |
Request.Url.Host |
localhost |
Request.Url.Port |
1897 |
Request.Url.Authority |
localhost:1897 |
Request.Url.LocalPath |
/news/press/content.aspx/123 |
Request.pathinfo |
/123 |
Request.Url.PathAndQuery |
/news/press/content.aspx/123?id=1 |
Request.Url.Query |
? id=1 |
Request.Url.Fragment |
|
Request.Url.Segments |
/ news/ press/ content.aspx/ 123 |
Asp. NET in Request.applicationpath, Request.filepath, Request.path,. Request.mappath