2023-10-12 02:40:26 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
2023-10-19 00:41:25 +04:00
|
|
|
|
string resultFilePath = "/var/result/data.txt";
|
2023-10-12 02:40:26 +04:00
|
|
|
|
|
|
|
|
|
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);
|