using System;
using System.IO;
public class Program
{
static string ReadFirstLine(string path)
StreamReader file = null;
string buffer = null;
try
file = new StreamReader(path);
buffer = file.ReadLine();
}
catch (Exception e)
Console.WriteLine("Error reading from {0}. Message = {1}", path, e.Message);
finally
if (file != null)
file.Close();
return buffer;