FilePicker represents a control that allows a user to pick a file.
Step 1: Create a Blank Windows 10 Universal App (C#) and enter App Name.
Step 2:
Next add one Button and two Textblock controls for displaying information from the toolbox then change the button name to SelectAPicture and TextBlock2 Name: OutputTextBlock.
Next add one Button and two Textblock controls for displaying information from the toolbox then change the button name to SelectAPicture and TextBlock2 Name: OutputTextBlock.
Step 3: Add the following namespace.
- using System.Threading.Tasks;
- using Windows.Storage.Pickers;
- using Windows.Storage;
Copy and paste the following code to the SelectAPicture Button event in the cs page.
- private async void SelectAPicture _Click(object sender, RoutedEventArgs e)
- {
- FileOpenPicker openPicker = new FileOpenPicker();
- openPicker.ViewMode = PickerViewMode.Thumbnail;
- openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
- openPicker.FileTypeFilter.Add(".jpg");
- openPicker.FileTypeFilter.Add(".jpeg");
- openPicker.FileTypeFilter.Add(".png");
- StorageFile file = await openPicker.PickSingleFileAsync();
- if (file != null)
- {
- OutputTextBlock.Text = "Selected Photo:" + file.Name;
- }
- else
- {
- OutputTextBlock.Text = "Operation cancelled.";
- }
- }

Read more articles on Window 10:


Manimekalai GanesanPosted May 17, 2016, 12:54 AM EDT
Nice one sir
Bhuvanesh MohankumarPosted May 3, 2016, 9:53 PM EDT
Good one
Gowtham RajamanickamTOP 100Posted Apr 20, 2016, 4:38 AM EDT
great
Asfend YarPosted Feb 21, 2016, 7:47 AM EST
and great effort
Asfend YarPosted Feb 21, 2016, 7:47 AM EST
good
Asfend YarPosted Feb 21, 2016, 7:47 AM EST
nice
Keval LangaliaPosted Feb 17, 2016, 2:38 AM EST
What about the PickSingleFileAndContinue() method..? which one is better to use.. thanks and nice share by the way.
Asfend YarPosted Feb 13, 2016, 7:09 AM EST
great
Ankit BansalPosted Feb 12, 2016, 11:32 PM EST
Good example but it can be extended with more features..but still nice..
Santhakumar MunuswamyPosted Feb 12, 2016, 9:43 PM EST
Thanks for nice share
Nigel FernandesPosted Feb 12, 2016, 9:24 PM EST
Interesting
Dr.Venkatesan BalakrishnanPosted Feb 12, 2016, 5:44 PM EST
good one
Gowtham KTOP 100Posted Feb 12, 2016, 5:53 AM EST
Good One, Thanks for sharing:)
Shubham KumarPosted Feb 11, 2016, 7:40 PM EST
nice keep share
Sibeesh VenuTOP 100Posted Feb 11, 2016, 7:35 PM EST
Nice Share
Amit Kumar SinghPosted Feb 11, 2016, 7:14 PM EST
Nice one Sir
Ammar ShaukatPosted Feb 11, 2016, 4:39 PM EST
Good
Vignesh ManiTOP 100Posted Feb 11, 2016, 11:43 AM EST
Nice One Sir
Kuppurasu NagarajTOP 100Posted Feb 11, 2016, 8:15 AM EST
thank you
Mohammed IbrahimPosted Feb 11, 2016, 8:12 AM EST
nice