|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
checking for EOFHow does one check for end-of-file while using the Streamreader class
methods? File opened like so... inputstream = File.OpenRead(Infile) Dim SrRead As StreamReader = New StreamReader(inputstream, _ System.Text.Encoding.ASCII) I intend to do-while not EOF using SrRead.Readline and I can't figure out what to use for the EOF check. Thanks
Show quote
Hide quote
"Dave Cullen" <nospam@mail.com> schrieb According to the documentation, ReadLine returns Nothing if the end of the > How does one check for end-of-file while using the Streamreader > class methods? > > File opened like so... > > inputstream = File.OpenRead(Infile) > Dim SrRead As StreamReader = New StreamReader(inputstream, _ > System.Text.Encoding.ASCII) > > I intend to do-while not EOF using SrRead.Readline and I can't > figure out what to use for the EOF check. > > Thanks stream is reached. Armin "Dave Cullen" <nospam@mail.com> schrieb: Reading a text file line-by-line or blockwise with a progress indicator> I intend to do-while not EOF using SrRead.Readline and I can't figure > out what to use for the EOF check. <URL:http://dotnet.mvps.org/dotnet/faqs/?id=readfile&lang=en> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Hi,
I think StreamReader.Peek() replicates that functionality. Just use : While (SrRead.Peek() > -1) : Regards,: End While Cerebrus.
Reading Stream After RedirectStandardOutput=True Blocks
I can't find the error here.... Serial Date Stored procedure handling 1 parent record and multiple child recor vb.net to c# conversion help please Loop through columns of all datarows in a dataset my form cannot from from network DataGridView validation to underlying DataSource Problems using HasMorePages with oleDbDatareader Hide some columns of listview |
|||||||||||||||||||||||