Results 1 to 2 of 2

Thread: StreamReader question - just curious

Hybrid View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    StreamReader question - just curious

    Hello,

    Just curious, what's the difference between:

    Code:
    Dim sr As StreamReader = File.OpenText(SourceFileLocation)
    and
    Code:
    Dim sr As StreamReader = New StreamReader(SourceFileLocation)
    Both do the same thing of course and both works, but I'm just curious which method I should be using.

    Thanks,

    Strick

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: StreamReader question - just curious

    top one is clearly a text file.
    The second one could be a binary file.
    Which one to use depends on the file. If it's a text file, then use the openText.... if it's binary data, then use the streamReader....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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