FileSystem.DirectoryExists(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Parameters
- directory
- String
Path of the directory.
Returns
True
if the directory exists; otherwise False
. This method also returns False
if the parameter represents the name and path of a file rather than a directory.
Examples
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
Applies to
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.