System.IO.IsolatedStorage.IsolatedStorageFile.GetDirectoryNames Method

Enumerates the directories in an isolated storage scope that match a given search pattern.

Syntax

public string[] GetDirectoryNames (string searchPattern)

Parameters

searchPattern
A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported.

Returns

An array of the relative paths of directories in the isolated storage scope that match searchPattern. A zero-length array specifies that there are no directories that match.

Remarks

Wildcard characters must only be in the final element of a searchPattern. For instance, "directory1/*etc*" is a valid search string, but "*etc*/directory" is not.

The searchPattern "Project\Data*" will give all subdirectories of Project beginning with Data in the isolated storage scope. The searchPattern "*" will return all directories located in the root. For complete description of search string criteria, see the System.IO.Directory class.

For information on getting file names, see the IsolatedStorageFile.GetFileNames(string) method.

The [<topic://cpconfindingexistingfilesdirectories>] example demonstrates the use of the IsolatedStorageFile.GetDirectoryNames(string) method.

Requirements

Namespace: System.IO.IsolatedStorage
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0