I am trying to copy the entire file format file (.txt, .pdf, .doc ...) from the source folder to the destination.
I have code to write for a text file only.
What should I do to copy all format files?
My code is:
string fileName = "test.txt"; string sourcePath = @"E:\test222"; string targetPath = @"E:\TestFolder"; string sourceFile = System.IO.Path.Combine(sourcePath, fileName); string destFile = System.IO.Path.Combine(targetPath, fileName);
Code for copying the file:
System.IO.File.Copy(sourceFile, destFile, true);
source share