When a workstation is switched on in our Internet cafe we need to have a way of ensuring that the client application, which communicates with the server, is also started. There are two ways of doing this: manually and automatically. You will probably want the application to load automatically. Windows services will let us accomplish this task. Keep reading to find out what they are and how to use them.
Internet Access: Client Service - The service application code (Page 2 of 4 )
So far we have looked at what a service is and how it works. Now we will write the code to make our service active. Before we write the code, let's look at what we want our service to do.
Basically we want it to see if the client application is running. If it is not, then we want it to start the application, otherwise we want it to do nothing. The service must check every couple of seconds or minutes (depending on your choice) to see if the client application is active.
Below is the entire service application code. Note that I’ve now saved the unit as “icstarter.” I’ve also added a timer component. The following properties are set: