const string new_dir = @"F:\Documents and Settings\Misbah Khan Afridi\My Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\Images"; string extension = System.IO.Path.GetExtension(oldPath); string renamed_name = textBox1.Text + "" + extension; string fName = System.IO.Path.Combine(new_dir, renamed_name); if (File.Exists(fName)) File.Delete(fName); System.IO.File.Copy(oldPath, fName); pictureBox1.Image = null;
Path.GetDirectoryName(Application.ExecutablePath)
Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)