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();
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
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();
}
}
}