如何在Windows Phone 8上打开文件?(How open files on Windows Phone 8?)
在我的应用程序中,我下载了几种文件(如音频,视频,pdf,powerpoint等)。
所以我从webserver收到这些数据作为byte []对象。
所以我想现在用视频播放器或pdfreader打开它们。
我应该做些什么?
我尝试过这段代码,但我想只有当你的项目文件夹中存有一个文件时才会有效(这不是我的情况)......不是吗?
// Access the file. StorageFile pdfFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("FileToRead.pdf"); // Launch the pdf file. await Windows.System.Launcher.LaunchFileAsync(pdfFile);In my app I download several kinds of files (like audio,video,pdf,powerpoint,ect) .
So I receive those data from the webserver as byte[] objects.
So I would like to open them with a video player or a pdfreader now.
What am I supposed to do?
I tried this code but I guess it only works if ou have a file stored in your project's folder(that's not my case)...doesn't it?
// Access the file. StorageFile pdfFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("FileToRead.pdf"); // Launch the pdf file. await Windows.System.Launcher.LaunchFileAsync(pdfFile);最满意答案
使用此命令从隔离存储中获取文件
var file = await ApplicationData.Current.LocalFolder.GetFileAsync(filename);Use this to get a file from Isolated Storage
var file = await ApplicationData.Current.LocalFolder.GetFileAsync(filename);
更多推荐
发布评论