Getting IIS Application filesystem path

前端 未结 2 636
自闭症患者
自闭症患者 2021-02-07 06:09

I have IIS 7.0 installed on and there is a .net application with a .svc service there.

I would like to point a file in the virtual directory pointed by the application (

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-07 07:08

    try this might help to resolve your issue

    string apPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;
    

    or

    string apPath = System.Web.Hosting.HostingEnvironment.MapPath("~/folder/file");
    

提交回复
热议问题