Sunday, 5 July 2015

How to create a Folder in local drive in vb.net

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
       Dim dr As New DirectoryInfo("C:\createfolder")

        If dr.Exists Then
            MsgBox("exists")

            If MsgBox("Do you want to Delete?", MsgBoxStyle.YesNo, "Question") = MsgBoxResult.Yes Then
                dr.Delete()

                MsgBox("Deleted")
                Exit Sub
            End If
        End If

        dr.Create()
        MsgBox("Created")
    End Sub