Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A first chance exception of type
- 'System.UnauthorizedAccessException'
- occurred in AccessingPictures.exe
- public async void getFile()
- {
- StorageFolder folder = KnownFolders.MusicLibrary;
- try
- {
- sampleFile = await folder.GetFileAsync("Test1.mp3");
- }
- catch (FileNotFoundException e)
- {
- // If file doesn't exist, indicate users to use scenario 1
- Debug.WriteLine(e);
- }
- }
- private void btnRead_Click(object sender, RoutedEventArgs e)
- {
- getFile();
- }
- Void GetCameraPhotos()
- {
- using (var library = new MediaLibrary())
- {
- PictureAlbumCollection allAlbums = library.RootPictureAlbum.Albums;
- PictureAlbum cameraRoll = allAlbums.Where(album => album.Name == "Camera Roll").FirstOrDefault();
- var CameraRollPictures = cameraRoll.Pictures
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement