简体   繁体   中英

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

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

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

Path returns a blank string. How do I get the path to return properly?

Thanks in advance for the help

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM