Backup files
using System;
using System.IO;
string sourceDir = @"C:\Users\Jano\Documents\";
string backupDir = @"C:\Users\Jano\Documents\backup\";
string[] textFiles = Directory.GetFiles(sourceDir, "*.txt");
foreach (string textFile in textFiles)
{
string fileName = textFile.Substring(sourceDir.Length);
File.Copy(Path.Combine(sourceDir, fileName),
Path.Combine(backupDir, fileName), true);
}
Console.WriteLine("Files copied");