如何在多個文件夾中查找圖像?這是我目前的代碼,但它只能從一個文件夾中檢索。從多個文件夾中檢索圖像
string imgFilePath = @"C:\Users\may\Documents\Visual Studio 2013\WebSites\EV\photo\"
+ textBoxEmplNo.Text + ".jpg";
if (File.Exists(imgFilePath))
{
pictureBox1.Visible = true;
pictureBox1.Image = Image.FromFile(imgFilePath);
}
else
{
//Display message that No such image found
pictureBox1.Visible = true;
pictureBox1.Image = Image.FromFile(@"C:\Users\may\Documents\Visual Studio 2013\WebSites\EV\photo\No-image-found.jpg");
}
檢索怎麼樣?從1個文本框?隨機?只需選擇一條路徑?你必須解釋你的問題 – EpicKip
http://stackoverflow.com/questions/11628021/c-sharp-how-to-customize-openfiledialog-to-select-multiple-folders-and-files –
@EpicKip是的,搜索圖像從1文本框。從該文本框中,它檢查圖像所具有的文件,然後在圖像框處顯示圖像。 – Miza