我从隔离存储启动文档,当我调试下一个代码时,前一个流被关闭并获得此异常。
"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);
答案 0 :(得分:0)
1)确定如果你从URI下载文件比你应该使用WebClient而不是HttpWebRequest 2)确保你输入正确的URI