TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Alessandro De Cristofaris
NA
2
2.6k
How to save a file after selected it with FileOpenPicker c#
Nov 4 2014 4:31 AM
I using windows phone silverlight and when run the code in the instruction "StorageFile file = await fileOpenPicker.PickSingleFileAsync();" it generates an exception "The request is not supported", I have already consulted the guide on how to keep an app after calling a method of selecting the file, but it seems that this is only for Windows Phone RunTime.
Does anyone know how can I do?
This is the code:
private async void btn_Crea_Click(object sender, RoutedEventArgs e)
{
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
openPicker.ContinuationData["Operation"] = "UpdateVideo";//"UpdateProfilePicture";
openPicker.FileTypeFilter.Add(".3GP");
openPicker.FileTypeFilter.Add(".MP4");
openPicker.FileTypeFilter.Add(".WMV");
openPicker.FileTypeFilter.Add(".AVI");
openPicker.FileTypeFilter.Add(".MOV");
openPicker.FileTypeFilter.Add(".3G2");
openPicker.PickSingleFileAndContinue();
->StorageFile file = await openPicker.PickSingleFileAsync(); // file represents the video selected by user <-
if (file != null)
{
// Open a stream for the selected file
Windows.Storage.Streams.IRandomAccessStream fileStream =
await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
// Set the video file
Singleton.Instance.video = file; // save a video file in the singleton for future use
}
}
Reply
Answers (
0
)
What is thread Life cycle ?
Regular Expression in C#