Export (0) Print
Expand All

NotifyFilters Enumeration

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)

public enum NotifyFilters

Member nameDescription
FileNameThe name of the file.
DirectoryNameThe name of the directory.
AttributesThe attributes of the file or folder.
SizeThe size of the file or folder.
LastWriteThe date the file or folder last had anything written to it.
LastAccessThe date the file or folder was last opened.
CreationTimeThe time the file or folder was created.
SecurityThe security settings 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.

Use the System.Diagnostics and System.IO namespaces for this example.

No code example is currently available or this language may not be supported.

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.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft