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
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