Have you ever wanted to write an application that constantly monitors a folder and raises events when there is any activity in that folder? In the good old days using VB6, you had to use windows APIs to do something like this, which was not very simple and required a lot of coding.
The Microsoft .NET Framework has introduced classes like System.IO and System.Diagnostics, which contain the FileSystemWatcher class. This class can raise events when a file is created, renamed, updated or deleted from the specified folder.
In this article we're going to learn how to implement the FileSystemWatcher class using Microsoft Visual Basic.Net. You will need the .NET framework installed, as well as Visual Studio.Net if you want to experiment with the source code presented in this article.
Comments