5 out of 12 rated this helpful - Rate this topic

Directory.GetFiles Method

Returns the names of files in a specified directory.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method Static member GetFiles(String) Returns the names of files (including their paths) in the specified directory.
Public method Static member GetFiles(String, String) Returns the names of files (including their paths) that match the specified search pattern in the specified directory.
Public method Static member GetFiles(String, String, SearchOption) Returns the names of files (including their paths) that match the specified search pattern in the specified directory, using a value to determine whether to search subdirectories.
Top
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Illegal characters in path when getting the list of named-pipes
When running this instruction on my machine:
string[] pipeList = Directory.GetFiles(@"\\.\pipe\");

I receive the following exception:
{System.ArgumentException: Illegal characters in path.

This only occurs when Adobe Reader Update process is running. Using ProcessExplorer, I found out that the adobe process uses a named-pipe with non-ascii characters. This is still a bug in the GetFiles method. Reproduceable in .net 2.0, 3.5 & 4.0

Thanks