Answers for "c# copy file"

C#
4

c# copy file

File.Copy(Path.Combine(sourceDir, fName), Path.Combine(distDir, fName));
Posted by: Guest on May-05-2020
3

move file from one folder to another c#

//take all files of main folder to folder model_RCCMrecTransfered 
            string rootFolderPath = @"F:/model_RCCMREC/";
            string destinationPath = @"F:/model_RCCMrecTransfered/";
            string filesToDelete = @"*_DONE.wav";   // Only delete WAV files ending by "_DONE" in their filenames
            string[] fileList = System.IO.Directory.GetFiles(rootFolderPath, filesToDelete);
            foreach (string file in fileList)
            {
                string fileToMove = rootFolderPath + file;
                string moveTo = destinationPath + file;
                //moving file
                File.Move(fileToMove, moveTo);
Posted by: Guest on April-30-2020
1

How to copy a file in C#

File.Copy(path, path2);
Posted by: Guest on July-30-2021

C# Answers by Framework

Browse Popular Code Answers by Language