ASP in Server.MapPath usage

Source: Internet
Author: User

always forget the usage of Server.MapPath, the following record, later use:
Total Note: The path obtained by Server.MapPath is the physical path on the Server, which is the absolute path that is always said
1, Server.MapPath ("/")
Note: Get the location where the application root folder is located. such as C:\Inetpub\wwwroot\.


2, Server.MapPath ("./")
Note: To get the current folder on the page, it is equivalent to Server.MapPath ("").


3, Server.MapPath (".. /")
Note: Get the parent folder for your page.


4, Server.MapPath ("~/")
Note: To get the current application-level program folder, assume that the root folder is the root folder, assuming that the virtual folder is where the virtual folder is located. such as C:\Inetpub\wwwroot\Example\.

Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.

ASP in Server.MapPath usage

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.