FileSystem.DirectoryExists(String) Método
Definição
Retornará True se o diretório especificado existir.Returns True if the specified directory exists.
public:
static bool DirectoryExists(System::String ^ directory);
public static bool DirectoryExists (string directory);
static member DirectoryExists : string -> bool
Public Shared Function DirectoryExists (directory As String) As Boolean
Parâmetros
- directory
- String
O caminho do diretório.Path of the directory.
Retornos
True se o diretório existir; caso contrário, False.True if the directory exists; otherwise False. Esse método também retornará False se o parâmetro representar o nome e caminho de um arquivo em vez de um diretório.This method also returns False if the parameter represents the name and path of a file rather than a directory.
Exemplos
Este exemplo determina se o diretório C:\backup\logs existe e verifica suas propriedades.This example determines whether the directory C:\backup\logs exists and checks its properties.
If My.Computer.FileSystem.DirectoryExists("C:\backup\logs") Then
Dim logInfo = My.Computer.FileSystem.GetDirectoryInfo(
"C:\backup\logs")
End If