How to get website's physical path on local IIS server? (from a desktop app)

前端 未结 3 1808
花落未央
花落未央 2020-12-24 07:16

How to get the path that usually looks like %SystemDrive%\\inetpub\\wwwroot ?

I guess it\'s something to do with Microsoft.Web.Administration.Se

3条回答
  •  庸人自扰
    2020-12-24 07:52

    Server.MapPath

    or

    Request Object Paths Available

    RequestObject Property

    PhysicalApplicationPath -Returns local file system path of the virtual root for this app. c:\inetpub\wwwroot\webstore

    PhysicalPath -Returns the local file system path to the current script or path. c:\inetpub\wwwroot\webstore\admin\paths.aspx

    Updates

    To access iis from the windows application go through this article : Modification of IIS Metabase in C# ( For IIs 6.0,5.0)

提交回复
热议问题