Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 4
System.IO
Directory Class
Directory Methods
Collapse All/Expand All Collapse All
Members FilterMembers Filter
Frameworks FilterFrameworks Filter
This page is specific to
Microsoft Visual Studio 2010/.NET Framework 4

Other versions are also available for the following:
.NET Framework Class Library
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.

  NameDescription
Public methodStatic memberEnumerateFileSystemEntries(String)Returns an enumerable collection of file-system entries in a specified path.
Public methodStatic memberEnumerateFileSystemEntries(String, String)Returns an enumerable collection of file-system entries that match a search pattern in a specified path.
Public methodStatic memberEnumerateFileSystemEntries(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.
Top
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
.NET 4 file Enumeration APIs throw unwanted exceptions and halt processing      Terry McConnell   |   Edit   |   Show History
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
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker