using (OpenFileDialog dlg = new OpenFileDialog()) { dlg.Title = "Open Image"; dlg.Filter = "All Files|*.*"; if (dlg.ShowDialog() == DialogResult.OK) { //PictureBox Picture = new PictureBox(); pictureEdit1.Image = new Bitmap(dlg.FileName); }
//build save to folder path using application path string saveToPath = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "FileFolder"); //combine path with original file name and build full path string saveToFullPath= Path.Combine(saveToPath, Path.GetFileName(dlg.FileName)); //copy file to folder System.IO.File.Copy(dlg.FileName, saveToFullPath);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)