24 lines
774 B
C#
24 lines
774 B
C#
using System;
|
|
using System.IO;
|
|
|
|
string resultFilePath = "../var/result/data.txt";
|
|
|
|
using (StreamWriter writer = new StreamWriter(resultFilePath, false))
|
|
{
|
|
foreach (var file in Directory.GetFiles("/var/data"))
|
|
{
|
|
using (StreamReader sr = new StreamReader(file))
|
|
{
|
|
String line;
|
|
Int16 i=0;
|
|
while ((line = sr.ReadLine()) != null)
|
|
{
|
|
i++;
|
|
}
|
|
writer.WriteLine(i.ToString());
|
|
Console.WriteLine("Количество строк в файле: " + i.ToString());
|
|
}
|
|
}
|
|
}
|
|
Console.WriteLine("Файл первого приложения успешно создан: " + resultFilePath);
|