Is there something like this in VB.Net?

  • Thread starter Thread starter Keith Rebello
  • Start date Start date
K

Keith Rebello

When reading from a text file in VB6, we could use:

Input #FileNumber, Variable1, Variable2, ...

to read directly into variables. Is there something equivalent in VB.Net?
 
Hi Keith,

In VB.NET you'll want to use FileStreams to read from files. I'm sure we'd
be happy to provide an example if you'd like.

-- Alex Papadimoulis
 
* "Keith Rebello said:
When reading from a text file in VB6, we could use:

Input #FileNumber, Variable1, Variable2, ...

to read directly into variables. Is there something equivalent in VB.Net?

You will have to split thatt up into multiple calls to 'Input', one for
each variable.
 
I guess I could use a StreamReader to read each line and then use the
String.Split method to get the individual values from each line and then
assign them to the variables.
Is there a way to directly assign the read values to variables, as you read
each line in the file?
 
Back
Top