How to get virtual directory physical path

前端 未结 6 2223
没有蜡笔的小新
没有蜡笔的小新 2021-01-04 20:55

As we know that a virtual direcoty can be linked to a folder with a diffrent name, how can I get the physical path of a virtual directory ?

I\'ve been trying with Ht

6条回答
  •  轮回少年
    2021-01-04 21:45

    This is what worked for me:

    string physicalPath =    
    System.Web.Hosting.HostingEnvironment.MapPath(HttpContext.Current.Request.ApplicationPath);
    

提交回复
热议问题