Posted by John Nichols on August 23, 2017 at 15:57:30 user Mcneacail.
In Reply to: Re: Clarification: Re: BELLS posted by John Nichols on August 23, 2017 at 15:54:57:
A service application is designed to be long-running, so it usually polls or monitors something in the system. The monitoring is set up in the OnStart method. However, OnStart doesn’t actually do the monitoring. The OnStart method must return to the operating system after the service's operation has begun. It must not loop forever or block. To set up a simple polling mechanism, you can use the System.Timers.Timer component as follows: In the OnStart method, set parameters on the component, and then set the Enabled property to true. The timer raises events in your code periodically, at which time your service could do its monitoring. You can use the following code to do this:
Post a followup (Only if you agree to the Terms and Conditions)