Monitor a Directory for a New File
The .NET Framework includes the
System.IO.FileSystemWatcherclass to listen for operating system events indicating there are file or directory changes. It can be used to monitor when a file is added, deleted, updated, or even renamed. It relies on the implementation of event handlers to decide how each of the scenarios gets handled. This example will let you try your own version.