gpt4 book ai didi

c++ - 如何在 Win8/Metro/WinRT 中获取 DocumentsLibrary 的绝对路径?

转载 作者:太空狗 更新时间:2023-10-29 20:29:02 24 4
gpt4 key购买 nike

我的 manifestappx 文件设置可以访问文档库访问和文件关联,但是当我调用

Windows::Storage::KnownFolders::DocumentsLibrary->Path 

路径返回一个空字符串。如何获得正确返回的路径?

在此先感谢您的帮助

最佳答案

因为 DocumentsLibrary是代表不同位置和文件集合的虚拟位置,它不会有路径:

Libraries, a concept introduced in Windows 7, allow users to view related user content from a single location. Because the library is a virtual location, folders that are added to or removed from a library continue to exist in their original locations as well.

此外,MSDN documentation for StorageFolder.Path状态:

Do not rely on this property to access a folder because some folders may not have file-system paths. For example if the folder is a file group, or is backed by a URI, or was picked using the file picker, the folder is not guaranteed to have a file-system path.

关于c++ - 如何在 Win8/Metro/WinRT 中获取 DocumentsLibrary 的绝对路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11302799/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com