Let's say we have the following specifications :
- We want an application that will turn continuously on a machine
- This application shall require no manual interaction (starting automatically)
- This application shall monitor a specific folder on the file
The specifications are very simple and we will probably start thinking to a windows service that would be launched in an automatic manner. This service could then use a FileSystemWatcher to do its job.
We'll see in this post how we can create this service and how to start / stop the FileSystemWatcher in the OnStart and OnStop event of the service, and to parameter it, specifying the properties NotifyFilter and EnableRaisingEvents.
We'll also see how we can install the service and specify that it will start automatically on each startup of Windows.
Finally we'll give some extra links to be able to customize the behavior of the service.
[Plus]