GetFileNames Method (String)
Collapse the table of content
Expand the table of content

IsolatedStorageFile.GetFileNames Method (String)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Enumerates files in isolated storage scope that match a given pattern.

Namespace:  System.IO.IsolatedStorage
Assembly:  mscorlib (in mscorlib.dll)

Public Function GetFileNames ( _
	searchPattern As String _
) As String()


Type: System.String
A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported.

Return Value

Type: System.String ()
An Array of relative paths of files in the isolated storage scope that match searchPattern. A zero-length array specifies that there are no files that match.


The store has been removed.


Isolated storage is disabled.


searchPattern is badly formed.


searchPattern is Nothing.


Cannot find a part of the searchPattern.


The store has been disposed.

The searchPattern "Project\Data*.txt" will give all ".txt" files beginning with Data in the Project directory of the isolated storage scope. For complete description of search pattern strings, see System.IO.Directory.

For information about how to find directory names, see the GetDirectoryNames method.

The following example gets an array of file names from a subdirectroy.

Dim searchpath As String = Path.Combine(subdirectory1, "*.*")
Dim filesInSubDirs() As String = store.GetFileNames(searchpath)

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft