When learning ASP, I summarized the usage syntax of Server.MapPath: Server.MapPath (path) ' path for you to specify the path purpose: To translate the virtual path specified by path into the actual path
LearnASPThe Server.MapPath of the time, the use of their own summary
Syntax: Server.MapPath (PATH) ' path for you to specify the paths
Purpose: To convert the virtual path specified by path to the actual path
Example:
1) server.mappth ("page.asp") ' Find the actual path of the page page.asp
2) server.mappth ("/") ' Find the root directory
3) Server.MapPath ("./") "Find out the current directory (note: Many books are written in this, but write their own after the hint is wrong)
Attention: Parameter path must be a virtual path, otherwise there will be an error!
Example:
If you currently invoke the Server.MapPath page as: http://www.xxx.com/putinfo/test.asp, and you save the file in Http://www.xxx.com/putinfo/img, You can use either of the following two methods:
1) path= "/putinfo/img"
2) path= "IMG"
That is, if the first character of path is "/" or "\", then Server.MapPath interprets it as a path that starts at the root directory, otherwise Server.MapPath interprets it as a path starting from the current directory.