FileInfo.CopyTo(String fileName)
using System;
using System.IO;
public class MainClass
{
static void Main(string[] args)
{
FileInfo MyFile = new FileInfo(@"c:\Projects\Testing.txt");
MyFile.Create();
MyFile.CopyTo(@"c:\Folder\Testing.txt");
//or
MyFile.CopyTo(@"c:\Folder\Testing.txt", true);
}
}
Related examples in the same category