FileSystem.DirectoryExists(String) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Retourne True si le répertoire spécifié existe.
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
Paramètres
- directory
- String
Chemin d’accès du répertoire.
Retours
True si le répertoire existe ; sinon False. Cette méthode retourne False également si le paramètre représente le nom et le chemin d’accès d’un fichier plutôt qu’un répertoire.
Exemples
Cet exemple détermine si le répertoire C:\backup\logs existe et vérifie ses propriétés.
If My.Computer.FileSystem.DirectoryExists("C:\backup\logs") Then
Dim logInfo = My.Computer.FileSystem.GetDirectoryInfo(
"C:\backup\logs")
End If