For a project I'm doing I have to steamread a file into a list box. I dont know if my path is right because the explore path bar on top of my explore start menu isnt showing up. Can anyone tell me if my logic looks right and then help me to get somthing to find the path to my file.
Private Sub lstProducts_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstProducts.SelectedIndexChange
Dim reader As IO.StreamReader = Nothing
Try
reader = New IO.StreamReader("C:\OrdersFile.txt")
While (reader.Peek <> -1)
Me.lstProducts.Items.Add(reader.ReadLine())
End While
Catch ex As IO.FileNotFoundException
MessageBox.Show("Error: File not found!")
End Try
reader.Close()
End Sub
End Class