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