[UWP] [C#] Filepicker和FolderPicker没有Start-Path。 SuggestedStartLocation是一个笑话。 [英] [UWP][C#]Filepicker and FolderPicker have no Start-Path. SuggestedStartLocation is a joke.

查看:88
本文介绍了[UWP] [C#] Filepicker和FolderPicker没有Start-Path。 SuggestedStartLocation是一个笑话。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在UWP下,仍然无法从沙箱中打开文件夹或文件。甚至建议路径是不可能的。


在UWP中实际实现文件或文件夹的选择(多么简单但又愚蠢)


            FolderPicker picker = new FolderPicker();

            picker.FileTypeFilter.Add(" *");

            picker.ViewMode = PickerViewMode.Thumbnail;

            picker.SuggestedStartLocation = PickerLocationId.ComputerFolder;

            picker.CommitButtonText ="选择一个文件夹" ;;

            StorageFolder picked_Folder = await picker.PickSingleFolderAsync();


所以picker.SuggestedStartLocation不是路径的字符串,而只是选择的库。微软是否真的相信用户和开发人员接受最低预算设置?


现在,在伟大的Windows 10秋季创作者更新后,它仍然是转换并发展为UWP的笑话。

解决方案

嗨  Raimund_Popp,


默认情况下,UWP应用程序可以访问某些文件系统位置,但大多数情况下,他们只能直接访问其安装文件夹及其应用程序数据文件夹。同时,StorageItems类(即StorageFolder和StorageFile)是Windows应用商店应用的规范
存储标识符,而不是路径。你可以看到博客  跳过路径:坚持使用StorageFile 以了解有关
的更多信息,使用UWP应用中的路径。


此外,如果您需要一些新功能,您可以将功能请求提交到UserVoice网站:


https:// wpdev.uservoice.com/forums/110705-universal-windows-platform


祝你好运,


Breeze


Under UWP it is still not possible to open a folder or file out of the sandbox. Even to suggest a path is not possible.

actual implementing an selection of file or folder in UWP (how easy but stupid)

            FolderPicker picker = new FolderPicker ();
            picker.FileTypeFilter.Add("*");
            picker.ViewMode = PickerViewMode.Thumbnail;
            picker.SuggestedStartLocation = PickerLocationId.ComputerFolder;
            picker.CommitButtonText = "Select a Folder";
            StorageFolder picked_Folder = await picker.PickSingleFolderAsync();

so picker.SuggestedStartLocation is not a string to a path, but only a selection of libraries. does microsoft really believe that users and developers accept that lowest budget setup?

now after the great Windows 10 Fall Creators Update it is still a joke to switch and develop to UWP.

解决方案

Hi Raimund_Popp,

UWP apps can access certain file system locations by default, for the most part, they can directly access only their install folder and their application data folder. Meanwhile, StorageItems classes (i.e. StorageFolder and StorageFile) are the canonical storage identifiers for Windows Store apps, not the path. You can see the blog Skip the path: stick to the StorageFile to learn more about using the path in UWP apps.

Besides, if you need some new feature, you can submit the feature request to the UserVoice website:

https://wpdev.uservoice.com/forums/110705-universal-windows-platform.

Best regards,

Breeze


这篇关于[UWP] [C#] Filepicker和FolderPicker没有Start-Path。 SuggestedStartLocation是一个笑话。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆