Eof

bokaraton

Member
Joined
Nov 25, 2003
Messages
23
Is there an equivalent to text.AtEndOfStream?

I have vb6.0 code that loops/reads thru a text file til end of stream which I am trying to convert over to vb.net.

Code:

Do While text.AtEndOfStream <> true
code
Loop
 
Yes.
Assuming that text is a StreamReader, you can have
Do Until text.Peek = -1
:)

You also have the option of reading the whole file with
s = text.ReadToEnd
 
Back
Top