If there is a path to the picture on the Web site is this: http://localhost:2008/websit1/images/1.jpg
WEBSIT1 represents a virtual path or a site
In asp.net, if we enter Response.Write (Request.mappath ("/01.jpg") in the. CS page;
This can output the physical path of the picture, which is the exact path to the image on the server.
Relative paths in HTML
Copy Code code as follows:
... /indicates switching to the previous level directory Http://localhost:2008/01.jpg
./or do not fill in the current path http://localhost:2008/websit1/01.jpg
/indicates that the root directory returns the root directory of the Web site http://localhost:2008/01.jpg
~/can only be used in asp.net and can only be used in server controls
If it is a site or a virtual directory, it represents the root directory.
Copy Code code as follows:
Response.Write (Request.maoppath ("~/01.jpg")) obtained is Response.Write (Request.mappath ("/01.jpg")); The same physical path