Results 1 to 2 of 2

Thread: Help!! Reading files with FileStream - ReadLine() Overloads? String too big?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770

    Help!! Reading files with FileStream - ReadLine() Overloads? String too big?

    This is driving me freaking crazy. This part of the code hangs on a 644kb file....

    fs = New FileStream(strSearchPath & "\" & folder.Name & "\" & file.Name, FileMode.Open, FileAccess.Read)
    sr = New StreamReader(fs)

    strBuffer = ""

    sr.BaseStream.Seek(0, SeekOrigin.Begin)

    While sr.Peek() > -1
    strBuffer &= sr.ReadLine()
    End While
    The error is Public Overrides Overloads Function ReadLine() As String

    and it seems that this part loops over and over again, resetting strBuffer
    While sr.Peek() > -1
    strBuffer &= sr.ReadLine()
    End While

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770

    Re: Help!! Reading files with FileStream - ReadLine() Overloads? String too big?

    Never mind.. i changed that to sr.ReadToEnd

    works better for what i want

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width