How do I get the absolute path of DocumentsLibrary in Win8/Metro/WinRT?

后端 未结 1 1404
眼角桃花
眼角桃花 2021-01-21 06:49

I have my manifestappx file setup to have access to Documents Library Access and a file association, but when I call

Windows::Storage::KnownFolders::DocumentsLi         


        
1条回答
  •  隐瞒了意图╮
    2021-01-21 07:18

    Because DocumentsLibrary is a virtual location representing a collection of different locations and files, it will not have a path:

    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.

    In addition, the MSDN documentation for StorageFolder.Path states:

    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.

    0 讨论(0)
提交回复
热议问题