IsolatedStorageFile.GetDirectoryNames Method (String)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Enumerates directories in an isolated storage scope that match a given pattern.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- searchPattern
- Type: System.String
A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported.
Return Value
Type: System.String ()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.
| Exception | Condition |
|---|---|
| IsolatedStorageException | The store has been removed. -or- Isolated storage is disabled. |
| ArgumentException | searchPattern is badly formed. |
| ArgumentNullException | searchPattern is Nothing. |
| DirectoryNotFoundException | Cannot find a part of the searchPattern. |
| ObjectDisposedException | The store has been disposed. |
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 Directory class.