Directory.EnumerateFileSystemEntries Method
Returns an enumerable collection of file-system entries in a specified path.
This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.
| Name | Description | |
|---|---|---|
|
EnumerateFileSystemEntries(String) | Returns an enumerable collection of file-system entries in a specified path. |
|
EnumerateFileSystemEntries(String, String) | Returns an enumerable collection of file-system entries that match a search pattern in a specified path. |
|
EnumerateFileSystemEntries(String, String, SearchOption) | Returns an enumerable collection of file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories. |
.NET 4 file Enumeration APIs throw unwanted exceptions and halt processing
When running as non-administrator, the new set of File system Enumeration APIs cannot be used to recursively enumerate files or folders in a reliable way. This is because the system enumerators throw exceptions when they encounter an inaccessible folder. Instead of ignoring the exception and moving on, the enumeration methods halt processing on the exception. Please note that Microsoft is aware of this and working on a fix:
https://connect.microsoft.com/VisualStudio/feedback/details/512171/directory-enumeratedirectory-etc-unusable-due-to-frequent-unauthorizedaccessexceptions-even-runas-administrator?wa=wsignin1.0
https://connect.microsoft.com/VisualStudio/feedback/details/512171/directory-enumeratedirectory-etc-unusable-due-to-frequent-unauthorizedaccessexceptions-even-runas-administrator?wa=wsignin1.0
- 5/17/2010
- Terry McConnell