📜  访问被拒绝的字符串以保存文件 uwp xamarin - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:16.610000             🧑  作者: Mango

代码示例1
FolderPicker folderPicker = new FolderPicker();
            folderPicker.FileTypeFilter.Add("*");
            StorageFolder folder = await folderPicker.PickSingleFolderAsync();
            if (folder != null)
            {
                StorageApplicationPermissions.FutureAccessList.AddOrReplace("PickedFolderToken", folder);
            }
            StorageFolder newFolder;
     
            newFolder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync("PickedFolderToken");
            await newFolder.CreateFileAsync("test.txt");
            // Fails. Same folder, create from path with an added file name.