Page 1 of 1

Reading text lines into an array c#?

Posted: Thu Dec 02, 2010 3:27 am
by chanika
I am writing an app that allows a user to navigate to a .txt file and with the file selected I need it to read the files lines creating a new array member based off each line. (though if you can think of an easier solution please feel free to mention it.)

__________________________________
khao san road

Re: Reading text lines into an array c#?

Posted: Thu Dec 02, 2010 12:45 pm
by bumpo
chanika wrote:I am writing an app that allows a user to navigate to a .txt file and with the file selected I need it to read the files lines creating a new array member based off each line. (though if you can think of an easier solution please feel free to mention it.)

__________________________________
khao san road



String[] lines = File.ReadAllLines(fileName);