Usage:
1. The location of the server. mappath ("/") application root directory is c: \ Inetpub \ wwwroot \
2. server. mappath ("./") indicates the current directory of the page
Note: It is equivalent to the physical file path on the page where server. mappath ("") is returned.
3. server. mappath ("../") indicates the directory at the upper level.
4. server. mappath ("~ /") Indicates the directory of the current application. If it is the root directory, it is the root directory. If it is a virtual directory, it is the location of the virtual directory, such as: C: \ Inetpub \ wwwroot \ example \
Note: It is equivalent to server. mappath ("~ ").
The following methods are equivalent to obtaining the Web. config file under the root directory of the page:
String filename = server. mappath ("./") + @ "\ WEB. config ";
String filename = server. mappath ("./") + "Web. config ";
String filename = server. mappath ("") + @ "\ WEB. config" // my usual method