FileSystem.DirectoryExists(String) 메서드

정의

지정된 디렉터리가 있는지를 반환 True 합니다.

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

매개 변수

directory
String

디렉터리의 경로입니다.

반품

디렉터리가 있으면 이고, 그렇지 않으면 . 이 메서드는 매개 변수가 디렉터리가 아닌 파일의 이름과 경로를 나타내는 경우에도 반환 False 됩니다.

예제

이 예제에서는 디렉터리가 C:\backup\logs 있는지 여부를 확인하고 해당 속성을 확인합니다.

If My.Computer.FileSystem.DirectoryExists("C:\backup\logs") Then
    Dim logInfo = My.Computer.FileSystem.GetDirectoryInfo(
        "C:\backup\logs")
End If

적용 대상