How do you detect if a Directory exists?

Joined
Jun 17, 2003
Messages
7
I am using Visual Basic .NET and I am trying to determine if a directory exists.

All I want to do is print "Directory Exists" if it does exist and "Directory Doesnt Exist" if it doesnt.

Can anyone help out?

Thanks,

Visualbasicuser
 
Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim dr As Directory
        If dr.Exists("C:\fakeDir") Then
            MessageBox.Show("it exsists!")
        Else
            MessageBox.Show("it doesnt exsist are you sure you put the correct directory name?")
        End If
    End Sub
:)
 
Back
Top