Reading a one line file

T_im

Newcomer
Joined
May 6, 2004
Messages
7
Location
Manchester, England
When I try reading a one line file code I get an error with this code:

Dim sr As New System.IO.StreamReader(File1.PostedFile.InputStream)
Dim rtf As String
rtf = sr.ReadLine()

rtf = rtf & sr.ReadToEnd
sr.Close()

How can I avoid this? For some reason I would also get the error with this too:

Dim sr As New System.IO.StreamReader(File1.PostedFile.InputStream)
Dim rtf As String
rtf = sr.sr.ReadToEnd
sr.Close()
 
PlausiblyDamp said:
Any chance you could tell us the error you are getting? Also does File1.PostedFile.InputStream point to a valid stream?

mmm, it seems to have sorted itself out now - can't remember doing anything to fix it lol
 
Back
Top