How to copy all files under a folder to another folder

A

ad

I want to copy all files under a folder to another folder.
If I use File.Copy(sourceFileName, destFileName, overwrite),
it must specify all files name in the source and destionation.

How can I copy all files in a directoy to another directory?
 
B

Barry Kelly

ad said:
I want to copy all files under a folder to another folder.
If I use File.Copy(sourceFileName, destFileName, overwrite),
it must specify all files name in the source and destionation.

How can I copy all files in a directoy to another directory?

How about copying them one at a time?

-- Barry
 
G

Guest

Why not just use Directory.Move()?

Directory.Move(sourceDirectory, destinationDirectory);
 
B

Barry Kelly

rmacias said:
Why not just use Directory.Move()?

Directory.Move(sourceDirectory, destinationDirectory);

Probably because moving isn't copying?

-- Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top