33 lines
700 B
C#
33 lines
700 B
C#
namespace _2023._09._12;
|
|
using System;
|
|
using System.IO;
|
|
|
|
class Program
|
|
{
|
|
|
|
static void Feladat1()
|
|
{
|
|
int sor = 0;
|
|
using (FileStream f = new FileStream(@"E:\Suli\12.b\Programozás (Tusjak Brigitta)\Források\sorok.txt", FileMode.Open, FileAccess.Read))
|
|
{
|
|
StreamReader r = new StreamReader(f);
|
|
string text = r.ReadLine();
|
|
System.Console.WriteLine(text);
|
|
|
|
while(text != null)
|
|
{
|
|
text = r.ReadLine();
|
|
sor++;
|
|
}
|
|
}
|
|
|
|
System.Console.WriteLine($"A fájl sorainak száma: {sor}");
|
|
|
|
}
|
|
|
|
static void Main(string[] args)
|
|
{
|
|
Feladat1();
|
|
}
|
|
}
|