Introduction
This
article will briefly explain how to create a simple "File Watcher”
application to run as a Windows Service the coding language used is C#.
Description
Use FileSystemWatcher
to watch for changes in a specified directory. You can watch for changes in
files and subdirectories of the specified directory. You can create a component
to watch files on a local computer, a network drive, or a remote computer.
Another
very useful class, FileSystemWatcher, acts as a watchdog for file system
changes and raises an event when a change occurs. You must specify a directory
to be monitored. The class can monitor changes to subdirectories and files
within the specified directory. If you have Windows 2000, you can even monitor
a remote system for changes. (Only remote machines running Windows NT or
Windows 2000 are supported at present.) The option to monitor files with
specific extensions can be set using the Filter property of the
FileSystemWatcher class