Im currently trying to put a picture into my second form when a condition is met on my first form. The code i'm using is:
secondForm.pictureBox1.Image = Image.FromFile(@"ID.jpeg");
Now im getting the usual "FileNotFound Exception unhandled" error. I had this issue when taking information from text files before but that was due to poor spelling (sigh). Im getting this error with ID.jpeg but its in the same folder as the text files which now work.
I should probably check that my "file path exists" but I don't know which folder my program is searching when looking for ID.JPEG! How could I find this out?
A word of warning. You can use Environment.CurrentDirectory; however, this isn't reliable because it can change at any time (i.e. any assembly can change this at will, so it may not be what you expect). Using CurrentDirectory is often a source of hard to track down bugs.