C# &引用;“文件名”;已损坏:Windows Phone 8.1

C# &引用;“文件名”;已损坏:Windows Phone 8.1,c#,windows-phone-8.1,isolatedstorage,launcher,C#,Windows Phone 8.1,Isolatedstorage,Launcher,我从独立存储启动文档,当我调试下一个代码时,上一个流被关闭,并得到这个异常 "File-Name" has been damaged and can't be opened. 请参见下面的我的代码: using (IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication()) { using (stream = storageFile.OpenFile("Document.do

我从独立存储启动文档,当我调试下一个代码时,上一个流被关闭,并得到这个异常

"File-Name" has been damaged and can't be opened.
请参见下面的我的代码:

 using (IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication())
 {
     using (stream = storageFile.OpenFile("Document.docx", FileMode.Create))
     {
        await stream.WriteAsync(buffer, 0, buffer.Length);
     }               
 }

StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile pdffile = await local.GetFileAsync("Document.docx");

await Windows.System.Launcher.LaunchFileAsync(pdffile);
1) 如果您是从URI下载文件,请确保您应该使用WebClient而不是HttpWebRequest
2) 确保您的paas是正确的URI

哪一行代码导致了错误?@Decademon感谢您兄弟的回复,但现在我收到了新的错误。“文件名”已损坏,无法打开“请帮助我,如何解决?”Decademon我正在尝试启动office文件和pdf文件。哪一行代码导致了第一个错误,哪一行代码导致了第二个错误?@xmashallax感谢兄弟yuour的回复,但现在我收到了新的错误。“文件名”“已损坏且无法打开”请帮助我,如何解决?我使用后台下载程序完成。在完全下载之前,我试图启动它,所以它已损坏。现在我解决了它。想看代码吗???@Deepak