public int GetAppNumber(string appName)
{
Int32 appPoolNum = 0;
DirectoryEntry w3svc = new DirectoryEntry("IIS://localhost/W3SVC);
foreach (DirectoryEntry child in w3svc.Children)
{
if (child.SchemaClassName == "IIsWebServer")
{
if (child.Properties["AppPoolId"].Value.ToString() == appName)
++appPoolNum;
}
}
return appPoolNum;
}
(IIS的应用程序池)
浙公网安备 33010602011771号