0

I am getting file by using FolderPicker from device, by using this below code.

FolderPicker pk = new FolderPicker();

        pk.SuggestedStartLocation = PickerLocationId.Downloads;
        pk.ViewMode = PickerViewMode.Thumbnail;
        pk.FileTypeFilter.Add("*");

        var folder = await pk.PickSingleFolderAsync();

        var files =await folder.GetFilesAsync();

        foreach (var files in files)
        {

        }

For each time i have to pick the folder location, for that reason i want to save the folder location first time, when i open app next time get the file from that path, any one please help me to achieve this.

Thank you,

Devi Prasad
  • 829
  • 1
  • 11
  • 33

2 Answers2

0

Use the FolderPicker.SettingsIdentifier for that. If you set the value to something like "My Downloads" then the next time you use the picker, it will start in the location you picked previously.

Michael S. Scherotter
  • 10,715
  • 3
  • 34
  • 57
  • I used SettingsIdentifier but it's asking for second time, i want to get files from first time picked location automatically. – Devi Prasad Jan 20 '17 at 08:50
-1

I found the answer in MSDN forms https://social.msdn.microsoft.com/Forums/windowsapps/en-US/b5a23a11-f526-4a59-bcca-af6a563589d9/save-folderpicker-location-for-next-time-in-windows-10-universal-apps-c?forum=wpdevelop

Devi Prasad
  • 829
  • 1
  • 11
  • 33
  • 1
    _[Your answer is in another castle: when is an answer not an answer?](http://meta.stackexchange.com/questions/225370/your-answer-is-in-another-castle-when-is-an-answer-not-an-answer)_. Consider editing your answer to contain a summary of the article pointed to by the link. –  Dec 29 '18 at 04:40