Exemplo n.º 1
0
        private async void RemoveTestFiles()
        {
            StorageFolder folder = await KnownFolders.GetFolderAsync(KnownFolderId.PicturesLibrary);

            try
            {
                StorageFile file = await folder.GetFileAsync("Test " + Extension + " file." + Extension);

                await file.DeleteAsync();
            }
            catch (Exception)
            {
                // File I/O errors are reported as exceptions.
                // Ignore errors here.
            }

            try
            {
                StorageFile file = await folder.GetFileAsync("Test file with no extension");

                await file.DeleteAsync();
            }
            catch (Exception)
            {
                // File I/O errors are reported as exceptions.
                // Ignore errors here.
            }
        }
Exemplo n.º 2
0
        private async void CreateTestFileWithNoExtension()
        {
            StorageFolder folder = await KnownFolders.GetFolderAsync(KnownFolderId.PicturesLibrary);

            await folder.CreateFileAsync("Test file with no extension", CreationCollisionOption.ReplaceExisting);

            await Windows.System.Launcher.LaunchFolderAsync(folder);
        }