Yves Corriveau

Yves Corriveau

  • 1.7k
  • 8
  • 510

Copy to Directory not working correctly

Jan 19 2021 6:15 PM
I have a file cope command in my app when I use the folderBrowserDialog an select a folder it copies the file to rhe wrong dir and add the dir path to the filename i.e \gcmfg\dir testFilename, I have looked aroun and have found nothing hope some one has an idea ,code below.
  
String folderpath="Null";
FolderBrowserDialog folderBrowserDilog1= new FolderBrowserDialog();
If folderBrowserDialog1.ShowDialog()==DialogResult.OK()
folderpath=folerBrowserDialog1.SelectPath(); 
MessageBox.Show (folderpath) ;    This Shows the path correctly
 File.Copy ("C:\\users\gcmfg\\Downloads\\Documents\\65 Cluch Rods.jpg",folderpath+"65 Cluch rod.jpg";
 
It copies in dir \gcmfg\dir test65cluchrods.jpg when folder select is \gcmfg\dir test. 
 
would appreciate any help.
Thank You
Gene 

Answers (3)