获得网站根目录方法

阅读 50

2023-05-10


获得物理目录的方法:

IIS 的当前网站路径:Server.MapPath("/") 

虚拟目录路径: Application("Path") = Server.MapPath(".") + "\" '

获得网站根目录方法_Server

           or    Request.ServerVariables("APPL_PHYSICAL_PATH")

获得虚拟目录的方法:

System.Web.HttpContext.Current.Request.ApplicationPath

精彩评论(0)

0 0 举报