Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27376

VB 2010 Express: Close File After ReadAllLines

$
0
0
I am a little confused and can't seem to find the answer to whether or not I need to close a text file once it's been read in by the ReadAllLines method.

Code:

Dim vArray() As String = File.ReadAllLines("C:\MyFile.txt")
All the examples I look at, no one actually closed the text file using this method. I am assuming that ReadAllLines closes the file when it's done...or am I making the wrong assumption here?

Viewing all articles
Browse latest Browse all 27376

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>