bishoe nb

bishoe nb

  • NA
  • 623
  • 80.2k

Could not find file 'openFileDialog1'.

Aug 23 2018 12:00 AM
When updating I do not choose which image shows the error shown
I may not want to update the image every time but I update other data
 
  1. #region SavePicProfile  
  2.            const string new_dir = @"E:\x\ProfilePIC\";  
  3.            //MessageBox.Show(openFDProfile.FileName);  
  4.            string extension = System.IO.Path.GetExtension(openFDProfile.FileName);  
  5.   
  6.            string renamed_name = ID_Member_ + "" + extension;  
  7.   
  8.            string fName = System.IO.Path.Combine(new_dir, renamed_name);  
  9.            if (File.Exists(fName))  
  10.                File.Delete(fName);  
  11.            System.IO.File.Copy(openFDProfile.FileName, fName);  
  12.            string msg = string.Format("Copied {0} to {1}", openFDProfile.FileName, fName);  
  13.            //MessageBox.Show(msg, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);  
  14.            #endregion 
System.IO.File.Copy(openFDProfile.FileName, fName); Additional information: Could not find file 'openFileDialog1'.
 
in PicImage_Regisrt_Click
 
 
  1. //image Register    
  2.            openFDProfileImage_Regisrt.Title = "Insert an image ";    
  3.            openFDProfileImage_Regisrt.InitialDirectory = "C:\\Users\bishoe\\Downloads";    
  4.            openFDProfileImage_Regisrt.FileName = "";    
  5.            openFDProfileImage_Regisrt.Filter = "JPEG Image|*.jpg|GIF Image|*.gif|PNG Image|*.png";    
  6.            openFDProfileImage_Regisrt.Multiselect = false;    
  7.            if (openFDProfileImage_Regisrt.ShowDialog() != DialogResult.OK)    
  8.                return;    
  9.     
  10.                //display image in pic box    
  11.     
  12.                PicImage_Regisrt.ImageLocation =    
  13.                openFDProfileImage_Regisrt.FileName;   
 

Answers (5)