可能重複:
Getting the application's directory from a WPF application獲取文件到指定的文件夾在C#
我想接取從項目目錄中的文件像Java中不使用 「C:\路徑」,因爲它創建文件例外到我的圖片框這是代碼到我的計時器
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++;
你的問題是什麼? – Oded
也類似於:http://stackoverflow.com/questions/3259583/how-to-get-files-in-a-relative-path-in-c-sharp –