IIS

  • Thread starter Thread starter powerranger
  • Start date Start date
P

powerranger

I would like to know if there is a way to determine if IIS is up and
running at run time either thru webservice or window service. Thanks.
 
You could try making a request to a known website/file and see if an error
is returned.
 
Hi,

One way of checking whether IIS is running using the ServiceController
class. You can use the below code snippet to check if IIS is running...

ServiceController iis = new ServiceController("W3SVC");
if (iis.Status.ToString() == "Running")
{
Do Something
}

Hope this helps...

Regards,
Madhu

MVP - C# | MCSD.NET
 
Thanks for your reply, Madhu. Can I use your code to detect page cannot
be displayed error type?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top