System.IO.SearchOption Enumeration

Specifies whether to search the current directory, or the current directory and all subdirectories.

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public enum SearchOption

Remarks

If you choose SearchOption.AllDirectories in your search and the directory structure contains a link that creates a loop, the search operation enters an infinite loop.

Members

Member NameDescription
AllDirectories

Includes the current directory and all its subdirectories in a search operation. This option includes reparse points such as mounted drives and symbolic links in the search.

TopDirectoryOnly

Includes only the current directory in a search operation.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0