简体   繁体   English

IIS-列出子站点及其所在的应用程序池?

[英]IIS - list subwebs and the app pools they are in?

I have an IIS 6.0 website with very many subwebs and several application pools. 我有一个带有很多子站点和几个应用程序池的IIS 6.0网站。

I would like help establishing which app pool each of the subwebs is in using c#. 我想要帮助建立使用c#的每个子站点所在的应用程序池。

I have looked at the DirectoryServices namespace but still not sure of what to do. 我看过DirectoryServices命名空间,但仍然不确定该怎么做。

Any help is appreciated. 任何帮助表示赞赏。

Thanks. 谢谢。

Have a peek at this question I realise this is for IIS7 but may be worth a try 窥见这个问题,我意识到这是针对IIS7的,但可能值得尝试

ServerManager manager = new ServerManager();
    foreach (Site site in manager.Sites)
    {
        foreach (Application app in site.Applications)
        {

            if (app.ApplicationPoolName.ToString() == AppPoolName)
            {
                 string appname = app.Path;
            }
        }
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM