IsolatedStorageFile.DirectoryExists Method

July 28, 2014

Determines whether the specified path refers to an existing directory in the isolated store.

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

'Declaration
Public Function DirectoryExists ( _
	path As String _
) As Boolean

Parameters

path
Type: System.String
The path to test.

Return Value

Type: System.Boolean
true if path refers to an existing directory in the isolated store and is not Nothing; otherwise, false.

ExceptionCondition
IsolatedStorageException

The isolated store has been removed.

-or-

Isolated storage is disabled.

ObjectDisposedException

The isolated store has been disposed.

The following example deletes a specific directory if it exists. This example is part of a larger example provided for IsolatedStorageFile class.


' Delete a specific directory.
Dim dirDelete As String = Path.Combine("MyApp1", "SubDir3")
Try
    If store.DirectoryExists(dirDelete) Then
        store.DeleteDirectory(dirDelete)
    End If
Catch ex As IsolatedStorageException
    sb.AppendLine(ex.Message)
End Try


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft