Returns the names of files in the collection that match the specified search pattern.

Namespace:  Rebex.IO
Assembly:  Rebex.Common (in Rebex.Common.dll)

Syntax

Visual Basic
Public Function GetFiles ( _
	searchPattern As String, _
	caseSensitive As Boolean _
) As String()
C#
public string[] GetFiles(
	string searchPattern,
	bool caseSensitive
)

Parameters

searchPattern
Type: System..::..String
The search string to match the items against.
caseSensitive
Type: System..::..Boolean
If tree, perform unix-like case-sensitive matching.

Return Value

A String array containing the names of files in the specified directory that match the specified search pattern.

Remarks

The following wildcards are permitted in searchPattern:
* - Zero or more characters.
? - Exactly one character.
Characters other than the wildcards represent themselves. For example, the searchPattern string "*.txt" searches for all names/paths ending with the ".txt". The searchPattern string "s*" searches for all names/paths beginning with the letter "s".

The method works in two different modes (determined by UsePath property): Filenames without path are searched and returned. This mode is used by default for collections returned by GetList method.Filenames with path are searched and returned. This mode is used by default for collection returned by GetItems method.

Version Information

.NET Compact Framework

Supported in: 3.9, 3.5

See Also