我有这个奇怪的问题。我有一个可以使用此代码WinRT Acces denied to file
var playlist = new Windows.Media.Playlists.Playlist();
...
WinJS.Utilities.id("appbar-save-button").listen("click", function()
{
var savePicker = new Windows.Storage.Pickers.FolderPicker();
savePicker.fileTypeFilter.append("*");
savePicker.pickSingleFolderAsync().then(function (folder)
{
playlist.saveAsAsync(folder, "My Playlist", Windows.Storage.NameCollisionOption.replaceExisting, Windows.Media.Playlists.PlaylistFormat.windowsMedia);
});
})
问题是当我试图进入电影这个文件与此代码
WinJS.Utilities.id("appbar-open-button").listen("click", function()
{
var openPicker = Windows.Storage.Pickers.FileOpenPicker();
openPicker.fileTypeFilter.append(".wpl");
openPicker.pickSingleFileAsync().then(function (file)
{
Windows.Media.Playlists.Playlist.loadAsync(file).then(function (playlist)
{
// Print the name of the playlist.
});
});
})
在注释行创建播放列表的应用程序,我得到一个异常:Cannot access the specified file or folder (⑰ᑲÕ). The item is not in a location that the application has access to (including application data folders, folders that are accessible via capabilities, and persisted items in the StorageApplicationPermissions lists). Verify that the file is not marked with system or hidden file attributes.
我已经给应用程序文档库功能与类型.wpl的文件类型关联,但我仍然得到此异常。我怎样才能解决这个问题
编辑:添加视频到未来的存取权限列表似乎解决了应用程序创建的播放列表的问题,但对于随机播放列表的问题仍然存在。
我有点想到问题不在播放列表文件中,而是视频中。试图将文件中的视频添加到未来的访问列表(或将它们移动到音乐库中)并且它可以正常工作。 –