Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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()

Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...