FileSystemWatcher.IncludeSubdirectories Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether subdirectories within the specified path should be monitored.
public:
property bool IncludeSubdirectories { bool get(); void set(bool value); };
public bool IncludeSubdirectories { get; set; }
[System.IO.IODescription("FSW_IncludeSubdirectories")]
public bool IncludeSubdirectories { get; set; }
member this.IncludeSubdirectories : bool with get, set
[<System.IO.IODescription("FSW_IncludeSubdirectories")>]
member this.IncludeSubdirectories : bool with get, set
Public Property IncludeSubdirectories As Boolean
Property Value
true
if you want to monitor subdirectories; otherwise, false
. The default is false
.
- Attributes
Remarks
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 subtree, not just the immediate child directories. The relative path to a file or directory within the subtree 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 subtree of the directory you are watching, and IncludeSubdirectories is true
, that directory will automatically be watched.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기