Best way to get application folder path

前端 未结 10 2304
無奈伤痛
無奈伤痛 2020-11-22 02:03

I see that there are some ways to get the application folder path:

  1. Application.StartupPath
  2. System.IO.Path.GetDirectoryName( System.
10条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 02:53

    For a web application, to get the current web application root directory, generally call by web page for the current incoming request:

    HttpContext.Current.Server.MapPath();
    
    System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;
    

    Above code description

提交回复
热议问题