Please donate to help keep TarBoard going

Service -- so really simple -- question is what do you want it to do exactly


[ Follow Ups ] [ Post Followup ] [ Previous # Next ] [ Start New Thread ] [ TarBoard ]

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:


Follow Ups:



Post a followup (Only if you agree to the Terms and Conditions)

Name:
Email (optional). This will be visible to everyone on TarBoard, and spammers:

Existing subject (please edit appropriately) :

or is it time to start a New Thread?

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

post direct to TarBoard test post first

Before posting it is necessary to be a registered user.


[ Follow Ups ] [ Post Followup ] [ TarBoard ]