G
Guest
I have the code below:
Private Sub cmdFill_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdFill.Click
Dim Employee As UploadFile, Count As Integer, Temp As String
FileNum = FreeFile()
FileOpen(FileNum, TextBox1.Text, OpenMode.Random, , , Len(Employee))
Count = 1
lstView.Items.Clear()
Do While Not EOF(FileNum)
FileGet(FileNum, Employee, Count)
Temp = Str(Employee.UploadID) '+ " " + Employee.Name + " " +
Employee.Surname
lstView.Items.Add(Temp)
Count = Count + 1
Loop
FileClose(FileNum)
End Sub
Where "UploadFile" is a structure with 3 fields and "TextBox1.Text =
test.txt". Unfortunately at "FIleGet" I get the error message:
'System.IO.EndOfStreamException' Unable to read beyond the end of the stream.
Frustrated please help.
Private Sub cmdFill_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdFill.Click
Dim Employee As UploadFile, Count As Integer, Temp As String
FileNum = FreeFile()
FileOpen(FileNum, TextBox1.Text, OpenMode.Random, , , Len(Employee))
Count = 1
lstView.Items.Clear()
Do While Not EOF(FileNum)
FileGet(FileNum, Employee, Count)
Temp = Str(Employee.UploadID) '+ " " + Employee.Name + " " +
Employee.Surname
lstView.Items.Add(Temp)
Count = Count + 1
Loop
FileClose(FileNum)
End Sub
Where "UploadFile" is a structure with 3 fields and "TextBox1.Text =
test.txt". Unfortunately at "FIleGet" I get the error message:
'System.IO.EndOfStreamException' Unable to read beyond the end of the stream.
Frustrated please help.