Tests if the given path refers to an existing directory on disk.
[Visual Basic] Public Shared Function DirectoryExists( _ ByVal path As String _ ) As Boolean [C#] public static bool DirectoryExists( string path ); [C++] public: static bool DirectoryExists( String* path ); [JScript] public static function DirectoryExists( path : String ) : Boolean;
true if path refers to an existing directory, false otherwise.
Exception Type | Condition |
---|---|
ArgumentException | path is the empty string ("") or contains only whitespaces. |
ArgumentNullException | path is null. |
IOException | path is invalid or an I/O error occurs (for example, a disk error). |
SecurityException | The caller does not have the required permission. |
NGWS Runtime Security:
FileIOPermissionAccess | Read flag required for read permission to the target directory's contents. |