Possible Duplicate:
Getting the application's directory from a WPF application
I want to acess files from project directory like in java without using “C:\Path” because it create file exception into my picture box this is code into my timer
if (imagecount == 30)
{
this.pictureBox1.Image = System.Drawing.Image.FromFile(@"C:\Users\Baloi\Documents\visual studio 2010\Projects\WinEX\WinEX\" + image() + ".jpg");
imagecount = 0;
}
else if (imagecount < 30)
imagecount++;
Aplication directory:
Executable Directory:
Based on your requirement you can use one of above with Path.Combine and build full path to your image location.
Or you can embed images in a resource file. then you can load them as