This page address: Request. URL;
Last page address:
Copy codeThe Code is as follows:
Request. UrlReferrer
Request. ServerViables ["http_referer"]
Request. RawUrl
Request. RawUrl. QueryAndPath
System. IO. Path. GetFileName (Request. FilePath. ToString ())
In ASP. in NET programming, requests are often used to obtain url-related information. There are multiple methods in the Request to obtain url information, but I often forget the specific functions of various methods, today, I wrote a test program to list the results of various methods. You can directly refer to it later.
The url of the test is a http://www.test.com/testweb/default.aspx and the result is as follows:
Copy codeThe Code is as follows:
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
When the url contains parameters, you can use:
HttpContext. Current. Request. Url. PathAndQuery. ToString ()