0
當從媒體庫中刪除圖像,我得到訪問被拒絕的錯誤。 這是我的代碼。如何刪除媒體庫中保存圖片照片在Windows手機c#
using (MediaLibrary _MediaLibrary = new MediaLibrary())
{
foreach (PictureAlbum album in _MediaLibrary.RootPictureAlbum.Albums)
{
if (album.Name == "Saved Pictures")
{
PictureCollection Pictures = album.Pictures;
foreach (Picture _Picture in Pictures)
{
if (_Picture.Name.Contains("Tattoo_" + FavoritesName))
{
File.Delete(_Picture.GetPath());
}
}
}
}