[ASP.] Absolute path and relative path

Source: Internet
Author: User

Directory

Absolute path

Relative path

Summarize

Absolute path

The absolute path is the real path on the hard disk of the file or directory on your home page. For example: e:\ new concept English \ New Concept English second book text pdf.pdf. The directory path based on the Web site root directory. This is called absolute, meaning that when all Web pages reference the same file, the path used is the same.

12 such as:<href= "/ABC"> text </ a > <  src= "/abc"/>3 "d:/abc/"--Represents the root directory, absolute path.

Relative path

A directory path that is based on the location of the Web page where the file is referenced. Therefore, when a Web page that is saved in a different directory references the same file, the path used will not be the same, so it is referred to as relative.

The following are some of the special symbols used to establish the path, and the meanings they represent.

1"."--Represents the current directory, relative path.23 such as:<AHref= "./abc"> Text</A> or<ImgSrc= "./abc"/>45"..."--represents the previous level of the directory, relative to the path.6<a href= ". /abc "> text </a< Span style= "color: #0000ff;" >> or <img src< Span style= "color: #0000ff;" >=".. /abc "/> 8  9 10 such as: <img src= ". /.. /abc "/>           

When using a relative path, we use the symbol "." To represent the current directory, with the symbol "..." To represent the parent directory of the current directory.

/is the Hypertext Protocol path separator symbol, all sites in the browser display the path separation is "/" is represented. It typically represents a virtual path.

In normal program code, the file path is delimited by "\". It generally refers to the physical path.

./indicates that under the current path,

.. /represents the upper-level path in the current path.

~/represents the root directory of the current Web site.

also/and \ \ is worth the wait!

There are two major systems for representing paths:
1, in Windows to represent the location of the file, with a backslash "\", for example: e:\ new concept English \ New Concept English second book pdf.pdf text

2, network path, such as http://www.i.cnblogs.com/EditPosts.aspx.

Note: In the path/and the difference between the backslash, in the operation of FTP is also used in the network path, if the use of \, is not resolved, before in the project, have eaten this aspect of the loss.

Summarize

~/in the Runat=server control, automatically resolves to the value of Request.applicationpath, which is the directory of the current application-level program (used in the server control).

/: Indicates the current directory.

.. /Represents a previous level of directory.

/represents the root directory.

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.