directory class : GetFiles(string) method
Description
Gets a list of files that match to the specified pattern.
Syntax
directoryInstance.GetFiles(string pattern)
Arguments
Class | Name | Description |
string | pattern | Search pattern. |
Return value
Class | Description |
list{file} | A list of files that match to the specified pattern. |
Sample code
1: | directory dir = new directory("c:\somewhere..."); |
2: | list{file} txtFiles = dir.GetFiles("*.txt"); // Files with the ".txt" extension. |
Notes
It's a wrapper of the System.IO.DirectoryInfo.GetFiles(String) method.
Please note that this method do not work recursively. It returns a list of direct children.