开发者

How to programmatically RESUME IIS website?

开发者 https://www.devze.com 2023-01-06 12:23 出处:网络
I\'m using the following code to start website when it is stopped. DirectoryEntry DE = new DirectoryEntry(string.Format(\"IIS://localhost/W3SVC/{0}\", siteID));

I'm using the following code to start website when it is stopped.

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

But it works only if the website is stop开发者_如何学Goped and not works if it is PAUSED. How can i start the website if it is in the PAUSED state?


To resume a site from the Paused state you should invoke the Continue method.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号