1, String str1 = Request.ApplicationPath.ToString (); The return path is: \holterclientweb
2, HttpServerUtility. MapPath method Explanation: returns the physical file path corresponding to the virtual path specified on the WEB server.
String path=Server.MapPath(Request.applicationpath + "/upload/reportfile");
After commissioning:
String str3= Server.MapPath ("./");
c:\\users\\administrator\\desktop\\holterclientweb\\filehandle\\
String str4= Server.MapPath (".. /");
c:\\users\\administrator\\desktop\\holterclientweb\\
String STR5 = Server.MapPath ("~/");
c:\\users\\administrator\\desktop\\holterclientweb\\
Additional:
./Current directory
/website Home directory
.. /Upper Directory
~/Web site virtual directory
3, String exe = HttpContext.Current.Server.MapPath("Pdf2swf.exe");
After commissioning:
4, String str6 = Server.MapPath (request.servervariables["Path_info"]);
5, String str7 = request.servervariables["path_translated"];
Other reference address: http://blog.csdn.net/ecdyf1989/article/details/5877648
Http://www.cnblogs.com/leixiaoling/archive/2012/03/30/2425466.html