Use the static methods in the type
System.IO.Directory
.
The method's name is GetFiles(...) and comes with three different signatures:
Excerpt from MSDN:
String[] GetFiles(String) //Returns the names of files (including their paths) in the specified directory.
String[] GetFiles(String, String) //Returns the names of files (including their paths) that match the specified search pattern in the specified directory.
String[] 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.
Regards,
— Manfred