Server.MapPath的使用方法

it2022-05-09  28

Server.MapPath的使用方法 总注:Server.MapPath获得的路径都是服务器上的物理路径,也就是常说的绝对路径 1、Server.MapPath("/") 注:获得应用程序根目录所在的位置,如 C:\Inetpub\wwwroot\。 2、Server.MapPath("./") 注:获得所在页面的当前目录,等价于Server.MapPath("")。 3、Server.MapPath("../") 注:获得所在页面的上级目录。 4、Server.MapPath("~/") 注:获得当前应用级程序的目录,如果是根目录,就是根目录,如果是虚拟目录,就是虚拟目录所在的位置,如C:\Inetpub\wwwroot\Example\。 posted on 2009-06-18 21:33 OTO 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/souso/archive/2009/06/18/1506167.html


最新回复(0)