Gets or sets a value indicating whether to watch files, directories, or files and directories within the given path.
[Visual Basic] Overridable Public Property Target As WatcherTarget [C#] public WatcherTarget Target {virtual get; virtual set;} [C++] public: __property virtual WatcherTarget get_Target(); public: __property virtual void set_Target(WatcherTarget); [JScript] public function get Target() : WatcherTarget; public function set Target(WatcherTarget);
One of the WatcherTarget values. The default is Both.
This property is used to determine whether the component should react to file changes, directory changes, or both file and directory changes. For example, if Target is set to listen only to file change notifications, and the Filter property is set to "*.txt", the creation of a directory called "MyDoc.txt" will not result in a change notification.
This is one way to filter out unwanted notifications. For more information on filtering out unwanted notifications, see the ChangedFilter, Filter, IncludeSubdirectories, and InternalBufferSize properties.
FileSystemWatcher Class | FileSystemWatcher Members | System.IO Namespace | ChangedFilter | Filter | IncludeSubdirectories | InternalBufferSize | WatcherTarget