using System;
namespace ConsoleApplication
{
class Program
static void Main(string[] args)
using (System.IO.StreamReader sr = new System.IO.StreamReader(@"C:\test1.txt"))
while (sr.Peek() > -1)
try
Console.WriteLine(sr.ReadLine()[0]);
}
catch { Console.WriteLine("Пустая строка"); }
Console.ReadKey();
using System;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
using (System.IO.StreamReader sr = new System.IO.StreamReader(@"C:\test1.txt"))
{
while (sr.Peek() > -1)
{
try
{
Console.WriteLine(sr.ReadLine()[0]);
}
catch { Console.WriteLine("Пустая строка"); }
}
}
Console.ReadKey();
}
}
}