tags:

views:

51

answers:

2

A remoting application is hosted on server using IIS. I need code to check that the hosted application is running or not. Is any way? Please suggest.

A: 

You can do a Ping right? Check this link for more information about Ping Class

Anuraj
+1  A: 

You have a low acceptance rate - if people give you the right info then at least thank them by marking them as the answer.
You also didn't specify what language you were using, it is hard to give good answers when the question is incomplete. I'm going to assume you are using C#.

This line will get you the IIS instance:

DirectoryEntry iisInstance = new DirectoryEntry(string.Format("IIS://{0}/w3svc", serverName));

you will need to reference the IISOle library and various System.DirectoryServices namespaces (this link will get you started, there are thousands more out there for doing IIS stuff from code). If you get an error back when trying to connect to the IIS instance then either the machine is not running, the IIS instance is not running, or you may not have sufficient privileges to connect to it. So that is how you check if IIS is running. Once you have a reference to the IIS instance you can do a whole heap of other stuff including enumerating applications and websites and app pools.

As for whether the application is running - have you actually tried the simple thing and tried to connect and instantiate a remote object?

slugster