// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.IO; using System.Collections; class MainClass { public static void Main(string[] args) { ArrayList list = new ArrayList(); StreamReader f = new StreamReader("C:\\test.dat"); string[] line = new string[3]; for(int i = 0; i < 3; i++) { line[i] = f.ReadLine(); } for(int i = 0; i < 3; i++) { Console.WriteLine(line[i]); } } }