FileSystemProxy.DirectoryExists(String) メソッド

定義

指定したディレクトリが存在する場合は、 True を返します。

public:
 bool DirectoryExists(System::String ^ directory);
public bool DirectoryExists(string directory);
member this.DirectoryExists : string -> bool
Public Function DirectoryExists (directory As String) As Boolean

パラメーター

directory
String

ディレクトリのパス。

返品

True ディレクトリが存在する場合。それ以外の場合は False

この例では、ディレクトリ C:\backup\logs が存在するかどうかを判断し、そのプロパティを確認します。

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

適用対象

こちらもご覧ください