简体   繁体   中英

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.

I would like help establishing which app pool each of the subwebs is in using c#.

I have looked at the DirectoryServices namespace but still not sure of what to do.

Any help is appreciated.

Thanks.

Have a peek at this question I realise this is for IIS7 but may be worth a try

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;
            }
        }
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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