I may not want to update the image every time but I update other data
- #region SavePicProfile
- const string new_dir = @"E:\x\ProfilePIC\";
- //MessageBox.Show(openFDProfile.FileName);
- string extension = System.IO.Path.GetExtension(openFDProfile.FileName);
- string renamed_name = ID_Member_ + "" + extension;
- string fName = System.IO.Path.Combine(new_dir, renamed_name);
- if (File.Exists(fName))
- File.Delete(fName);
- System.IO.File.Copy(openFDProfile.FileName, fName);
- string msg = string.Format("Copied {0} to {1}", openFDProfile.FileName, fName);
- //MessageBox.Show(msg, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- #endregion
System.IO.File.Copy(openFDProfile.FileName, fName); Additional information: Could not find file 'openFileDialog1'.
- //image Register
- openFDProfileImage_Regisrt.Title = "Insert an image ";
- openFDProfileImage_Regisrt.InitialDirectory = "C:\\Users\bishoe\\Downloads";
- openFDProfileImage_Regisrt.FileName = "";
- openFDProfileImage_Regisrt.Filter = "JPEG Image|*.jpg|GIF Image|*.gif|PNG Image|*.png";
- openFDProfileImage_Regisrt.Multiselect = false;
- if (openFDProfileImage_Regisrt.ShowDialog() != DialogResult.OK)
- return;
- //display image in pic box
- PicImage_Regisrt.ImageLocation =
- openFDProfileImage_Regisrt.FileName;


Mageshwaran RPosted Nov 23, 2019, 12:05 PM
bishoe nbPosted Aug 23, 2018, 9:54 AM
And re-add them
But the following error appeared
{
//image Register
//openFileDialog1.Title = "Insert an image ";
//openFileDialog1.InitialDirectory = "C:\\Users\bishoe\\Downloads";
//openFileDialog1.FileName = "";
//openFileDialog1.Filter = "JPEG Image|*.jpg|GIF Image|*.gif|PNG Image|*.png";
//openFileDialog1.Multiselect = false;
//if (openFileDialog1.ShowDialog() != DialogResult.OK)
// return;
//display image in pic box
//PicImage_Regisrt.ImageLocation =
//openFileDialog1.FileName;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
if (openFileDialog1.FileName != null && openFileDialog1.FileName != "")
{
PicImage_Regisrt.ImageLocation =
openFileDialog1.FileName;
}
}
Rafnas T PPosted Aug 23, 2018, 2:08 AM