Platform Core .NET Assemblies API
EnumerateFiles Method
See Also  Send Feedback
Terrasoft.IO Namespace > IDirectoryInfo Interface : EnumerateFiles Method
searchPattern
The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files.
searchOption
One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. The default value is System.IO.SearchOption.TopDirectoryOnly.

Glossary Item Box

Returns an enumerable collection of file information that matches a specified search pattern and search subdirectory option.

Syntax

 
C#
 
 

Parameters

searchPattern
The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files.
searchOption
One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. The default value is System.IO.SearchOption.TopDirectoryOnly.

Return Value

An enumerable collection of files that matches searchPattern and searchOption.

Exceptions

ExceptionDescription
System.ArgumentNullExceptionsearchPattern is null.
System.ArgumentOutOfRangeExceptionsearchOption is not a valid System.IO.SearchOption value.
System.IO.DirectoryNotFoundException The path encapsulated in the DirectoryInfo object is invalid (for example, it is on an unmapped drive).
System.Security.SecurityExceptionThe caller does not have the required permission.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© Terrasoft 2002-2018.