[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Returns the names of files (including their paths) in the specified directory.
Assembly: System.IO (in System.IO.dll)
The and methods differ as follows: When you use , you can start enumerating the collection of names before the whole collection is returned; when you use , you must wait for the whole array of names to be returned before you can access the array. Therefore, when you are working with many files and directories, can be more efficient.
The returned file names are appended to the supplied path parameter.
If there are no files, this method returns an empty array.
This method is identical to with the asterisk (*) specified as the search pattern.
The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.
The order of the returned file names is not guaranteed; use the method if a specific sort order is required.
The path parameter is not case-sensitive.
For a list of common I/O tasks, see Common I/O Tasks.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.