Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
System.IO
 IncludeSubdirectories Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework Class Library
FileSystemWatcher.IncludeSubdirectories Property

Gets or sets a value indicating whether subdirectories within the specified path should be monitored.

Namespace: System.IO
Assembly: System (in system.dll)

Visual Basic (Declaration)
Public Property IncludeSubdirectories As Boolean
Visual Basic (Usage)
Dim instance As FileSystemWatcher
Dim value As Boolean

value = instance.IncludeSubdirectories

instance.IncludeSubdirectories = value
C#
public bool IncludeSubdirectories { get; set; }
C++
public:
property bool IncludeSubdirectories {
    bool get ();
    void set (bool value);
}
J#
/** @property */
public boolean get_IncludeSubdirectories ()

/** @property */
public void set_IncludeSubdirectories (boolean value)
JScript
public function get IncludeSubdirectories () : boolean

public function set IncludeSubdirectories (value : boolean)

Property Value

true if you want to monitor subdirectories; otherwise, false. The default is false.

Set IncludeSubdirectories to true when you want to watch for change notifications for files and directories contained within the directory specified through the Path property, and its subdirectories. Setting the IncludeSubdirectories property to false helps reduce the number of notifications sent to the internal buffer. For more information on filtering out unwanted notifications, see the NotifyFilter and InternalBufferSize properties.

When true, IncludeSubdirectories is recursive through the entire sub tree, not just the immediate child directories. The relative path to a file or directory within the sub tree returns in the Name property of FileSystemEventArgs and the OldName property of RenamedEventArgs, depending on changes you are watching for. You can get the fully qualified path from the FullPath property of FileSystemEventArgs and the OldFullPath property of RenamedEventArgs, depending on the changes you are watching for.

If a directory is created in the sub tree of the directory you are watching, and IncludeSubdirectories is true, that directory will automatically be watched.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker