Server. mappath ()
./Current Directory
/Website home directory
../Upper directory
~ /Website virtual directory
If the current website directory is E: \ wwwroot ApplicationProgramThe virtual directory is E: \ wwwroot \ company. The page path is E: \ wwwroot \ company \ news \ show. asp.
Use
Server. mappath ("./") Return Path: e: \ wwwroot \ company \ news
Server. mappath ("/") Return Path: e: \ wwwroot
Server. mappath ("../") Return Path: e: \ wwwroot \ company
Server. mappath ("~ /") Return Path: e: \ wwwroot \ company
Server. mappath (request. servervariables ("path_info "))
Request. servervariables ("path_translated ")
The preceding two methods return the path D: \ wwwroot \ company \ news \ show. asp.
./Current Directory
/Website home directory
../Upper directory
~ /Website virtual directory
If the current website directory is E: \ wwwroot, the web page path browsed by E: \ wwwroot \ company is E: \ wwwroot \ company \ news \ show. asp
Use
Server. mappath ("./") Return Path: e: \ wwwroot \ company \ news
Server. mappath ("/") Return Path: e: \ wwwroot
Server. mappath ("../") Return Path: e: \ wwwroot \ company
Server. mappath ("~ /") Return Path: e: \ wwwroot \ company
Server. mappath (request. servervariables ("path_info "))
Request. servervariables ("path_translated ")
The preceding two methods return the path D: \ wwwroot \ company \ news \ show. asp.