From the question it appears that you want to create an
array or list
of size equal to the number of lines in the file. If the purpose is to store each line from the file into this array or list then
System.IO.File.ReadAllLines
method explained here
http://msdn.microsoft.com/en-us/library/s2tte0y1.aspx[
^]
can be used, which reads each line from the file into the array by creating an array of size equal to the number of lines in the file.