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.Namespace: System.IO
Assembly: System (in System.dll)
|The name of the file.|
|The name of the directory.|
|The attributes of the file or folder.|
|The size of the file or folder.|
|The date the file or folder last had anything written to it.|
|The date the file or folder was last opened.|
|The time the file or folder was created.|
|The security settings of the 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.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.