HOW TO FIND OUT IF A SERVICE PRESENT IN DIFFERENT MACHINE HAS BEEN STOPPED OR STARTED.

Awadhendra Tiwari

Total Post:505

Points:2525
Posted by  Awadhendra Tiwari
C# 
C#
 1982  View(s)
Ratings:
Rate this:
  1. Awadhendra Tiwari

    Post:505

    Points:2525
    How to find out if a service present in different machine has been stopped or started.

    Use ServiceController Class present in System.ServiceProcess namespace to determine the status of the service.
    Have a timer in the application which is monitoring the service. The timer should poll service to determine its status.
    ServiceController c = new ServiceController("<servicename>", "<machine name>");

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!