I have been working on converting an old application from VB 6.0 to VB.Net. I have used the VB.Net 2005 conversion tool, but it still requires more editing on my part to have it function properly. My problem deals with taking a .dat file and inputing the data into an array TestRecord(2) using the FileGet function.

The VB 6.0 code works fine as bellow:
FileName$ = "c:\Impact-E\TestFiles\" & Text1.Text & ".dat"
Open FileName$ For Random As #3 Len = Len(TestRecord(1))
Get #3, I, TestRecord(2)

But after I used VB.Net 2005 conversion tool and rewrote the code it still does not work.
FileName = "c:\Impact-E\TestFiles\" & Text1.Text & ".dat"
FileOpen(3, FileName, OpenMode.Random, , , Len(TestRecord(1)))
FileGet(3, TestRecord(2), I) 'Error occurs on this line

The VB.Net code will open and begins to read the data, but then gives me an error #5. Saying its unable to read beyond the end of the stream.