How to communicate between two process
-
i have a window service and window application two different projects. i am hendling a window service through window application for start, stop, Restarting the service. i am checking service using Timer in window Application for every 500 interval. but i want it without using Timer it should check the service status, if i stop service(in services) then it automatically show Stop in Window Application. Thanks Sanjit.rajbanshi@wlinktech.com
-
i have a window service and window application two different projects. i am hendling a window service through window application for start, stop, Restarting the service. i am checking service using Timer in window Application for every 500 interval. but i want it without using Timer it should check the service status, if i stop service(in services) then it automatically show Stop in Window Application. Thanks Sanjit.rajbanshi@wlinktech.com
There are several ways to do this. One easy way is to write it to windows log entry using the EventLog class. In the service you'll create a source with your service's name, and in the Stop() method of the service, you write an entry to the Log. In the applications use the same class to monitor that log. When an entry is written an event called EntryWritten will be raised. PS. This may not work when you service has been forcibly ended using the task manager.
Regards:rose: