Directory.Exists : Directory « System.IO « VB.Net by API






Directory.Exists

  

Imports System.IO

Module Module1


    Sub Main()
        Try
            If (Directory.Exists("D:\test01")) Then
                Console.WriteLine("D:\test01 already exists")
            Else
                Directory.CreateDirectory("C:\test01")
            End If

            Console.WriteLine("Directories created")
        Catch E As Exception
            Console.WriteLine("Error creating directory")
            Console.WriteLine("Error: {0}", E.Message)
        End Try
    End Sub

End Module

   
    
  








Related examples in the same category

1.Directory.CreateDirectory
2.Directory.Delete
3.Directory.GetCurrentDirectory()
4.Directory.GetDirectoryRoot
5.Directory.GetFileSystemEntries
6.Directory.GetLogicalDrives()
7.Directory.GetParent
8.Directory.Move
9.Directory.SetCurrentDirectory