How can I read from a file?  
Author Message
JuKiM





PostPosted: Visual Basic Express Edition, How can I read from a file? Top

Hello,

I have a ascii file, and I need to read it.
the file is like

Parameter1
Parameter2
Parameter3

And I have to read the three parameters and save them in another file. In VB6 i did this with
the open and input/output functions.. But how can ido it in .Net Thanks!





Visual Studio Express Editions2  
 
 
Andrej Tozon





PostPosted: Visual Basic Express Edition, How can I read from a file? Top

Hi,

if every line in the file is a single parameter, you could read the file's text as array of strings - each array item represents a line in the file:

Dim parameters() As String = System.IO.File.ReadAllLines(filename)

Andrej