Developing Mobile Apps — Question 19
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?
Answer options
- A. FileOpenPicker.PickSingleFileAsync()
- B. FileOpenPicker.PickMultipleFilesAsync()
- C. StorageItem.OpenSequentialReadAsync()
- D. StorageItem.GetFileFromPathAsync()
- E. StorageItem.OpenReadAsync()
Correct answer:
Explanation
The correct method is FileOpenPicker.PickSingleFileAsync() because it is specifically designed to allow users to select a single file. The other options either allow multiple file selections or are not intended for file picking dialogs.