Keeping Track of the File System

Some processes might require the presence or arrival of a file. For example, you might want to sort a file when it shows up on the machine running the sort process, or you might want to be notified when the sort has completed and the sorted file is available for further processing. Visual Basic .NET allows you to use the FileSystemWatcher component to dynamically track changes to the file system.

You can add a FileSystemWatcher to the component tray at the bottom of the form's designer or programmatically. Because FileSort is a console application, the component tray is not available. Therefore, we will add a FileSystemWatcher to the FileSort.sln programmatically and use it to notify us when the .tmp file containing ...

Get Visual Basic® .NET Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.