it was working before but now it will not load the file. i don't get a msgbox so i know it finds the file but it will not display in the lstbox
Private Sub btndisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndisplay.Click
Dim objstreamreader As System.io.StreamReader
Dim strfilename As String
Dim intloop As Integer
Dim pintrecordcounter As Integer
lstfilecontents.Items.Clear()
strfilename = txtfilename.Text
If System.IO.File.Exists(strfilename) = False Then _
MsgBox("File not Found")
Exit Sub
objstreamreader = System.IO.File.OpenText(strfilename)
Do Until objstreamreader.Peek = -1
pstrline(pintrecordcounter) = objstreamreader.ReadLine
pintrecordcounter += 1
Loop
objstreamreader.Close()
Do Until intloop >= pintrecordcounter
Loop
lstfilecontents.Items.Add(pstrline(intloop))
End Sub
Private Sub btndisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndisplay.Click
Dim objstreamreader As System.io.StreamReader
Dim strfilename As String
Dim intloop As Integer
Dim pintrecordcounter As Integer
lstfilecontents.Items.Clear()
strfilename = txtfilename.Text
If System.IO.File.Exists(strfilename) = False Then _
MsgBox("File not Found")
Exit Sub
objstreamreader = System.IO.File.OpenText(strfilename)
Do Until objstreamreader.Peek = -1
pstrline(pintrecordcounter) = objstreamreader.ReadLine
pintrecordcounter += 1
Loop
objstreamreader.Close()
Do Until intloop >= pintrecordcounter
Loop
lstfilecontents.Items.Add(pstrline(intloop))
End Sub