Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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)

[<FlagsAttribute>]
type NotifyFilters

Member nameDescription
Attributes

The attributes of the file or folder.

CreationTime

The time the file or folder was created.

DirectoryName

The name of the directory.

FileName

The name of the file.

LastAccess

The date the file or folder was last opened.

LastWrite

The date the file or folder last had anything written to it.

Security

The security settings of the file or folder.

Size

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.

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

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

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft