Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

So many ways to do the same thing

Status
Not open for further replies.

SSchimsky

MIS
Mar 26, 2002
16
0
0
US
Hi,

When I want to open a text file to read info I use this vb.net syntax:

Dim sr As New StreamReader("c:\MyText.txt")
Dim t As String
t = sr.ReadToEnd
sr.Close()

Is this not the perferred syntax? It seems to me, the most straight forward.

I'd like to know your thoughts on the various other ways to do this same task and why you believe one way is better than another.

Thanks.

Steve

 
Looks like it'll work for smaller files (< 1mb)
Go ahead and use it.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top