我正在查询 Android 设备上的所有图像:
string[] columns = { MediaStore.Images.Media.InterfaceConsts.Data,
MediaStore.Images.Media.InterfaceConsts.Id };
string orderBy = MediaStore.Images.Media.InterfaceConsts.Id;
var imagecursor = ManagedQuery(MediaStore.Images.Media.ExternalContentUri, columns, null, null, orderBy);
for (int i = 0; i < this.Count; i++) {
imagecursor.MoveToPosition(i);
Paths[i]= imagecursor.GetString(dataColumnIndex);
Console.WriteLine(Paths[i]);
Console.WriteLine(System.IO.File.Exists(Paths[i]));
}
问题是输出显示某些文件不存在。这是一个示例输出:
/storage/sdcard0/Download/On-Yom-Kippur-Jews-choose-different-shoes-VSETQJ6-x-large.jpg
错误
/storage/sdcard0/Download/397277_10151250943161341_876027377_n.jpg
错误
/storage/sdcard0/Download/Roxy_Cottontail_&_ ..._Some_Bunny_Love's_You.jpg
错误
/storage/sdcard0/Download/album-The-Rolling-Stones-Some-Girls.jpg
正确
/storage/sdcard0/Download/some-people-ust-dont-appreciate-fashion[1 ].jpg
真
/storage/sdcard0/Download/express.gif
真
...
/storage/sdcard0/Download/some-joys-are-expressed-better-in-silence.JPG
假
这怎么可能?我自己从网上下载了这些图片!它们应该存在于磁盘中。