How to get applications associated with a application pool in IIS7

后端 未结 3 569
轮回少年
轮回少年 2020-12-17 05:01

I have a virtual directory name. For this virtual directory i have to find out the application pool associated. Once i get the application pool i have to find out all the vi

3条回答
  •  [愿得一人]
    2020-12-17 05:38

    using (var serverManager = new ServerManager())
    {
        var apps = (from site in serverManager.Sites
                    from app in site.Applications
                    where app.ApplicationPoolName.Equals("DefaultAppPool")
                    select app);
    }
    

提交回复
热议问题