문제

I have got a app with the getItemsAsync()-method returning a file-object for a picture chosen by the user with a file picker. Now I would like to get the folder-object of the folder which contains the image to make the user able to switch between the pictures in that folder without using the filepicker again.

도움이 되었습니까?

해결책

The path is available upon return from the file picker. See:

Docs for StorageFile

You can in turn then call

Windows.Storage.StorageFolder.getFolderFromPathAsync(path)
                             .done( /* Your success and error handlers */ );

to get you the StorageFolder from that path.

Docs for GetFolderFromPathAsync()

다른 팁

if the app likely want to 'access' any file in the select folder, using FolderPicker is probably right. otherwise, the app will likely not have access to all files in the folder.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top