【问题标题】:How to programmatically RESUME IIS website?如何以编程方式恢复 IIS 网站?
【发布时间】:2010-07-05 09:04:18
【问题描述】:

我正在使用以下代码在网站停止时启动它。

DirectoryEntry DE = new DirectoryEntry(string.Format("IIS://localhost/W3SVC/{0}", siteID));
if ((Int32)DE.InvokeGet("ServerState") != MD_SERVER_STATE_STARTED)
     DE.Invoke("Start");

但它仅在网站停止时才有效,如果暂停则无效。如果网站处于 PAUSED 状态,我该如何启动?

【问题讨论】:

    标签: c# iis web directoryentry


    【解决方案1】:

    要从Paused 状态恢复站点,您应该调用Continue 方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-24
      • 1970-01-01
      • 2010-09-30
      • 1970-01-01
      • 2014-02-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-02
      相关资源
      最近更新 更多