System.IO.DirectoryInfo.EnumerateFileSystemInfos Method

Returns an enumerable collection of file system information in the current directory.

Syntax

public IEnumerable<FileSystemInfo> EnumerateFileSystemInfos ()

Returns

An enumerable collection of file system information in the current directory.

Remarks

The DirectoryInfo.EnumerateFileSystemInfos and DirectoryInfo.GetFileSystemInfos methods differ as follows:

Therefore, when you are working with many files and directories, DirectoryInfo.EnumerateFileSystemInfos can be more efficient.

This method pre-populates the values of the following System.IO.FileSystemInfo properties:

The returned collection is not cached; each call to the IEnumerable`1.GetEnumerator method on the collection will start a new enumeration.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0