zoukankan      html  css  js  c++  java
  • net应用程序池自动关闭的解决方法

    while (true)
    {
    using (ServerManager sm = ServerManager.OpenRemote("localhost"))
    {

    string poolname ="8080";//应用池名称

    ApplicationPool appPool = sm.ApplicationPools.FirstOrDefault(x => x.Name == poolname);
    if (appPool != null)
    {
    //当前应用程序是关闭状态,立刻开启
    if (appPool.State == ObjectState.Stopped)
    {
    appPool.Start();
    }
    else if (appPool.State == ObjectState.Unknown)
    {
    appPool.Recycle();
    }

    Console.Write("正在监视IIS状态,请勿关闭" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+" ");

    //10分钟检查一次
    System.Threading.Thread.Sleep(10000);

    }
    }
    }

  • 相关阅读:
    HDU 3068 Manacher
    HDU 6188最小费用流
    Codeforces Round #442 (Div. 2) Danil and a Part-time Job
    并查集
    HDU 5988最小网络流(浮点数)
    HOJ
    HOJ
    POJ
    POJ
    关于async
  • 原文地址:https://www.cnblogs.com/zengwangjing/p/9479746.html
Copyright © 2011-2022 走看看