using System;
using System.IO;
namespace NamespaceName
{
public class ClassName
{
public static void Main(string[] args)
{
string[] filePaths = Directory.GetFiles(args[0],"*.txt");
using(StreamWriter sw = new StreamWriter(args[1]))
{
foreach(string path in filePaths)
{
try{
using(StreamReader sr = new StreamReader(path))
{
string line;
while((line = sr.ReadLine()) != null)
{
sw.WriteLine(line);
}
sw.WriteLine();
}
}
catch(Exception e)
{
Console.WriteLine("The file could not be read:");
Console.WriteLine(e.Message);
}
}
}
}
}
}
Jak uzyskać taki efekt tylko z wykorzystaniem listy poleceń cmd