Go: ASP. Summary of path problems in NET __net

Source: Internet
Author: User

Ext: http://www.cnblogs.com/pumaboyd/archive/2006/09/13/502820.html

ASP. The path problem in net

This is my page request link http://localhost/MyWeb/Store/Page1.aspx?ddddd=9. The following is the path shown by the corresponding method, and a comparison should be made to find the way you want to get the path.

Request.rawurl

The original URL is defined as the section after the domain information in the URL. In the URL string http://www.contoso.com/articles/recent.aspx, the original URL is/articles/recent.aspx. The original URL includes a query string (if present).

/myweb/store/page1.aspx?ddddd=9

Request.path

The virtual path of the current request.

/myweb/store/page1.aspx

Request.pathinfo

For the URL Http://www.contoso.com/virdir/page.html/tail,PathInfo value is/tail.

Request.currentexecutionfilepath and Request.filepath

Currentexecutionfilepath returns the correct file path for the currently executed page in a redirection scheme such as Execute and Transfer. When the client redirects to another page,FilePath Returns the path to the initial page; Currentexecutionfilepath returns the path to the child page.

/myweb/store/page1.aspx

Request. Physicalapplicationpath

Gets the physical file system path of the root directory of the currently executing server application. (Directory of applications)

k:/myweb/myweb/

Request. PhysicalPath

Gets the physical file system path that corresponds to the requested URL.

K:/myweb/myweb/store/page1.aspx

Request.applicationpath

Gets the virtual application root path of the ASP.net application on the server.

/myweb

AppDomain.CurrentDomain.BaseDirectory

Gets the base directory that is used by the Assembly resolver to probe the assembly.

k:/myweb/myweb/

AppDomain.CurrentDomain.RelativeSearchPath

Gets the path relative to the base directory where the Assembly resolver should probe the private assembly.

Bin

Assembly.codebase

Gets the location of the originally specified assembly

File:///k:/MyWeb/MyWeb/bin/MyWeb.DLL

Assembly.location

Gets the location of the file's base code format if the loaded file containing the manifest is not shadow copied.

C:/windows/microsoft.net/framework/v1.1.4322/temporary asp.net files/myweb/a6aa4523/7564b5f7/assembly/dl2/ 19cb75f7/002a8314_c272c601/myweb.dll

Request.Server.MapPath ()

Maps the specified virtual path to a physical path.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.