Read from text file

            StreamReader sr = null;
            string file = @"c:\temp\test.txt";
            string line;
 
            try
            {
                sr = new StreamReader(file);
                while ((line = sr.ReadLine()) != null)
                {
                    Console.WriteLine(line);
                }
            }
            finally
            {
                if (sr!= null) sr.Dispose();
            }
            string file = @"c:\temp\test.txt";
            using (StreamReader sr = File.OpenText(file))
            {
                    string line;
                    while ((line = sr.ReadLine()) != null)
                    {
                        Console.WriteLine(line);
                    }
            }
           String[] values = line.Split(' ');
           int id = int.Parse(values[0]);
           ...