Click here to Skip to main content
16,003,880 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
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;
Posted

1 solution

VB
Path.GetDirectoryName(Application.ExecutablePath)
Or
VB
Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)

to get your application path.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900