tony-inpo Posted November 10, 2005 Posted November 10, 2005 Hi, first post so hey everybody, hope someone can give me a hand hereI can copy files and folders but I have to do it individually. Here’s the codestring strOrigFile = somelocation1; //defined by user string strDestLoc = somelocation2; //defined by user // Get the filename only string strFileName = System.IO.Path.GetFileName(strOrigFile); // Determine the full destination path including filename string strDestFile = System.IO.Path.Combine(strDestLoc, strFileName); // Copy the file System.IO.File.Copy(strOrigFile, strDestFile);How do I make it look for all the files in the Directory then copy them?ThanksTony
Dutchdre Posted November 11, 2005 Posted November 11, 2005 Read this tutorial:http://www.codeproject.com/csharp/copydire...esrecursive.asp
tony-inpo Posted November 11, 2005 Author Posted November 11, 2005 Nice one, cheers for that got it to work now
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now