In a previous example I have showed how to use ‘FileSystemWatcher’ class to monitor a directory. But there are times that we need to monitor multiple directories and if any changes are available, invoke a given method.
We can do that by using this method. First create a class. We’ll call this class ‘Watcher’
And we can use it to monitor multiple directories as shown below (for this example I have used a console application and I am only considering the change event):