You are developing a Universal Windows Platform (UWP) app. The app must allow the user to select only one file at a time.
You need to ensure that the app displays the appropriate dialog window.
Which method should you use? this.textBlock.Text = “Picked photo: ” + file.Name;
A.
FileOpenPicker.PickSingleFileAsync()
B.
FileOpenPicker.PickMultipleFilesAsync()
C.
StorageItem.OpenSequentialReadAsync()
D.
StorageItem.GetFileFromPathAsync()
E.
StorageItem.OpenReadAsync()
Explanation:
To pick a single file.
Windows.Storage.StorageFile file = await picker.PickSingleFileAsync();
if (file != null){
// Application now has read/write access to the picked file
}
else
{
this.textBlock.Text = “Operation cancelled.”;
}
https://docs.microsoft.com/en-us/windows/uwp/files/quickstart-using-file-and-folder-pickers#pick-a-
single-file-complete-code-listing