I am working in WinRT, and I am kind of stuck:
I am writing a music player with a media library capability. I keep information about the music (such as artists etc) in a SQLite database. I wanted to let the user keep his music anywhere he wants to, instead of the windows way, where it all has to be in the 'Music' library.
Users can add the music inside folders using a folder picker. The problem I have is this: how can I access these files later, e.g after the application restarts?
Keeping the path doesn't work, since I always get "Access Denied" errors. The only time I can access the files is using the StorageFile objects I get from browsing the folder.
How can I solve this issue?
As in the comments already given, the Windows.Storage.AccessCache (http://msdn.microsoft.com/en-us/library/windows/apps/br230566.aspx) is the API you need to use for this. However, instead of saving access to each individual StorageFile, use the folder picker and save permissions for the StorageFolder object instead (the API works for both). It's unlikely that you'll hit the 1000 item limit for folders.