Specifies changes to watch for in a file or folder.
This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
Assembly: System (in System.dll)
The attributes of the file or folder.
The time the file or folder was created.
The name of the directory.
The name of the file.
The date the file or folder was last opened.
The date the file or folder last had anything written to it.
The security settings of the file or folder.
The size of the file or folder.
You can combine the members of this enumeration to watch for more than one kind of change. For example, you can watch for changes in the size of a file or folder, and for changes in security settings. This raises an event anytime there is a change in size or security settings of a file or folder.
The following example creates a FileSystemWatcher to watch the directory that is specified at runtime. The component is set to watch for any changes in LastWrite and LastAccess time, the creation, deletion, or renaming of text files in the directory. If a file is changed, created, or deleted, the path to the file prints to the console. When a file is renamed, the old and new paths print to the console.
Available since 1.1