Get IIS site name from for an ASP.NET website

后端 未结 6 1373
长发绾君心
长发绾君心 2021-02-02 05:59

In my ASP.NET web app I\'d like to look up the name it was given when it was created in IIS, which is unique to the server. I\'d not interested in the domain name for the web si

6条回答
  •  情书的邮戳
    2021-02-02 06:19

    You will need to do the ServerManager.OpenRemote("serverName") first when connecting to a remote server.

    Basically doing something like this

                using (ServerManager srvMgr = ServerManager.OpenRemote("serverName"))
                {
    
                }
    

    see msdn help

提交回复
热议问题