获得网站根目录方法

获得物理目录的方法:

IIS 的当前网站路径:Server.MapPath("/") 
虚拟目录路径: Application("Path") = Server.MapPath(".") + "\" '
           or    Request.ServerVariables("APPL_PHYSICAL_PATH")

获得虚拟目录的方法:

System.Web.HttpContext.Current.Request.ApplicationPath

你可能感兴趣的:(获得网站根目录方法)