Private Sub Button2_Click(sender As Object, e As EventArgs) Handles btloadWld.Click
Dim openFileDialog1 As New OpenFileDialog()
Dim fpath As String
openFileDialog1.InitialDirectory = "c:\"
openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
openFileDialog1.FilterIndex = 2
openFileDialog1.RestoreDirectory = True
If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
fpath = openFileDialog1.FileName
Try
If IO.File.Exists(fpath) Then
Using sr As New IO.StreamReader(fpath)
While Not sr.EndOfStream
lbwld.Items.Add(sr.ReadLine) 'ever Row in ListBox lbwld
End While
End Using
Else
MsgBox("Oooops, File not found !!!")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub