carlAlex
8/19/2016 - 9:21 AM

C# Read each line of file

C# Read each line of file

using System;
using System.IO;

class Program
{
    static void Main()
    {
	//
	// It will free resources on its own.
	//
	string line;
	using (StreamReader reader = new StreamReader("file.txt"))
	{
	    line = reader.ReadLine();
	}
	Console.WriteLine(line);
    }
}