1
A
回答
1
好像您的解決方案是一個WinForm應用
,例如加載圖像的PictureBox
PictureBox1.Image = Image.FromFile("img\\image_file_name.jpg");
要知道美國可以這樣做
string img_folder_path = System.IO.Path.Combine(Application.StartupPath, @"img");
string path_to_image = System.IO.Path.Combine(img_folder_path, "image_filename.jpg");
PictureBox1.Image = Image.FromFile(path_to_image);
0
該文件夾的絕對路徑
如果修改img目錄下文件的Copy to output directory屬性並將其設置爲Copy如果更新,則可以直接訪問該文件,如
Image.FromFile("img\image.png")
想我的問題是我沒有圖像放到我的debug文件夾中,但我有固定的,感謝您的幫助 – PotHeadProgramer 2013-02-24 14:03:15