I had made this code for user to select a folder so that my two files will be copied to that. The code is this:
string sourcePath = @"C:\Documents and Settings\akib\";
string fileName1 = @"untitled.jpg";
string fileName2 = @"Copyuntitled.jpg";
DialogResult result = folderBrowserDialog1.ShowDialog();
if (result == DialogResult.OK)
{
var destinationFolderName = folderBrowserDialog1.SelectedPath;
if (Directory.Exists(destinationFolderName))
{
File.Copy(sourcePath + "/" + fileName1, destinationFolderName
+ "/" + fileName1);
File.Copy(sourcePath + "/" + fileName2, destinationFolderName
+ "/" + fileName2);
}
}
But now I want to to reverse of it. That is if user have two files in some location I want to copy that to the c:\programfiles\myfolder
. So FolderBrowseDialog
can be used in such case? If yes how?