NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Creating FileSystemWatcher Component Instances

You create an instance of the FileSystemWatcher component when you want to build file system monitoring into your application. FileSystemWatcher components allow you to connect to directories and watch for specific changes within them, such as the creation of new files, addition of subdirectories, and renaming of files or subdirectories.

To create an instance of the FileSystemWatcher component programmatically

  1. Create an instance of the FileSystemWatcher base class in code. Your code might look like this:
    [Visual Basic]
    Dim myWatcher as New FileSystemWatcher
    [C#]
    FileSystemWatcher myWatcher = new FileSystemWatcher ();
  2. Configure any other necessary properties for your component. For details, see Configuring FileSystemWatcher Component Instances.

See Also

Configuring FileSystemWatcher Component Instances | Introduction to File System Components