//method是管理应用程序池的方法,有三种Start、Stop、Recycle,而 AppPoolName是应用程序池名称
static void ConfigAppPool(string method,string AppPoolName)
{
DirectoryEntry appPool = new DirectoryEntry("IIS://localhost/W3SVC/AppPools");
DirectoryEntry findPool = appPool.Children.Find(AppPoolName,"IIsApplicationPool");
findPool.Invoke(method,null);
appPool.CommitChanges();
appPool.Close();
}
c# 回收应用池
最新推荐文章于 2024-01-02 16:21:41 发布