Check the status of an application pool (IIS 6) with C#
问题 How can I check the status of an IIS6 application pool with C# ? For example, I want to know if it is running or not ! Thank's in advance for your help ! 回答1: http://msdn.microsoft.com/en-us/library/ms524962.aspx You can do this checking the AppPoolState Property: protected void status() { string appPoolName = "dev.somesite.com"; string appPoolPath = @"IIS://" + System.Environment.MachineName + "/W3SVC/AppPools/" + appPoolName; int intStatus = 0; try { DirectoryEntry w3svc = new