218 - 问,C++CX:DocumentsLibrary-Path为什么是空

218 - 问,C++CX:DocumentsLibrary-Path为什么是空

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

为什么是空

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 documents library is not the right place to store private data. That should be stored in your application's data store. 

参考文章

http://stackoverflow.com/questions/11302799/how-do-i-get-the-absolute-path-of-documentslibrary-in-win8-metro-winrt

你可能感兴趣的:(218 - 问,C++CX:DocumentsLibrary-Path为什么是空)