J'ai besoin de savoir comment je peux détecter le pool d'applications en cours d'exécution, afin que je puisse le faire par programmation.Comment détecter quel pool d'applications je suis en train de courir? (IIS6)
Est-ce que quelqu'un sait comment faire cela pour IIS6?
Mon code actuel pour le recyclage de l'app-piscine est:
/// <summary>
/// Recycle an application pool
/// </summary>
/// <param name="IIsApplicationPool"></param>
public static void RecycleAppPool(string IIsApplicationPool) {
ManagementScope scope = new ManagementScope(@"\\localhost\root\MicrosoftIISv2");
scope.Connect();
ManagementObject appPool = new ManagementObject(scope, new ManagementPath("IIsApplicationPool.Name='W3SVC/AppPools/" + IIsApplicationPool + "'"), null);
appPool.InvokeMethod("Recycle", null, null);
}
Vous pouvez le faire maintenant. –