Adds a path or mask into collection of inclusion patterns. The supported wildcards are '?' and '*' and '**'. For detailed specification with examples see the documentation.

Namespace:  Rebex.IO
Assembly:  Rebex.Common (in Rebex.Common.dll)

Syntax

Visual Basic
Public Overridable Sub Include ( _
	pattern As String, _
	mode As TraversalMode _
)
C#
public virtual void Include(
	string pattern,
	TraversalMode mode
)

Parameters

pattern
Type: System..::..String
A path or mask (relative to the base path) which define an inclusion pattern.
mode
Type: Rebex.IO..::..TraversalMode
Specifies traversal mode of directories for the pattern.

Remarks

'?' matches any single character.
'*' matches any number of any characters except the directory separators.
'**' matches any number of any characters (directory separators can be reduced e.g. "a\**\b" is equivalent to "a\**\**\b" which matches "a\x\y\z\b" and also "a\b" but not "ab").

Examples

data\file-???.txtMatches files within the "data" directory e.g. "data\file-007.txt", but not "data\file-7.txt".
data\*.txtMatches any ".txt" file within the "data" directory (only within the "data" directory, not in subdirectories) e.g. "data\file.txt", but not "data\a\b\c\file.txt".
data\**\*.txtMatches any ".txt" file anywhere within the "data" directory and its subdirectories e.g. "data\file.txt" and also "data\a\b\c\file.txt".

Version Information

.NET Compact Framework

Supported in: 3.9, 3.5

See Also