I want to copy a file from A to B in C#. How do I do that?
The File.Copy method:
MSDN Link
This should work!
using System.IO;
...
var path = //your current filePath
var outputPath = //the directory where you want your (.txt) file
File.Copy(path,outputPath);
Without any error handling code:
File.Copy(path, path2);
System.IO.File.Copy
Use the FileInfo class.
FileInfo fi = new FileInfo("a.txt");
fi.CopyTo("b.txt");