Results 1 to 3 of 3

Thread: reading a file?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    reading a file?

    hmm there is the StreamReader that I've been using all the time, and then there is the FileStream class. Would someone care to explain the big difference between these. Which one should I use for reading text files?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    The FileStream is the class that basically is the file, the StreamReader is used to read or interept the data in the FileStream and convert it to more useful things (like strings). There are other kinds of Streams as well, like Memory and Network which all derive from the same base Stream Class. The StreamReader and Writer are what we use to interact with these streams, unless you want to do it byte by byte.

    To use an analog the Stream is like a CD and the Stream Reader/Writer is like the CD Player.

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    aha cool thanks, makes more sense
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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