I使用Windows Phone 8應用程序。檢查圖像資源是否爲空
string Image = "/MyData/" + myObject.ImageName + "big.png";
BitmapImage bmp = new BitmapImage(new Uri(Image , UriKind.Relative));
MyImage.Source = bmp;
我的文件夾中的圖像邁德特/,我有2套圖像像<imagename>big.png,<imagename>small.png.
因此,這裏所發生的事情是我想檢查是否存在於位置<imagename>big.png
與否,如果不挑<imagename>small.png.
如何做到這一點?
編輯
我解決了它自己,這裏是如何。
File.Exists("path to file") here path should be `folderName/filenames` and not `/folderName/filenames`
感謝所有幫助過我的人。
爲什麼要downvote?這個問題有什麼不對? – user3114009
你有沒有試過File.Exists方法? –
@JagathMurali是的,我試過了,它不工作, – user3114009