How to copy a file to another path?

Have a look at File.Copy()

Using File.Copy you can specify the new file name as part of the destination string.

So something like

File.Copy(@"c:\test.txt", @"c:\test\foo.txt");

See also How to: Copy, Delete, and Move Files and Folders (C# Programming Guide)

Leave a Comment