I have loaded to CodePlex a C# sample Windows Service project. The URL of the solution is https://commonservicecs.codeplex.com/.
The windows service calls an action function is a separate class project. This separation of responsibility is necessary to facilitate testing of the action. The downloads page at https://commonservicecs.codeplex.com/releases/view/138175 includes a help file with full instructions for configuring and installing this sample windows service. An NUnit test project is provided.
The action is a simple page scrape controlled by the database in respect of:
- Use of a custom event log to record exceptions.
- Recording a “heartbeat” into a date-time parameters.
- On/Off action from a Boolean parameter file, thus allowed a duly authenticated user to switch the action on and off without requiring administrative access.