3

如何在 windows phone 8 中打开文本文档、.docx 和 .xls 文档,我将文件保存在隔离存储中,然后尝试使用 Launcher.FileAsync 打开但没有得到结果。有关更多信息,请参阅下面的我的代码:

  string file = "Download.txt";
  IsolatedStorageFileStream isfStream = new IsolatedStorageFileStream(file, FileMode.Create, IsolatedStorageFile.GetUserStoreForApplication());

        isfStream.Close();


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

        Windows.System.Launcher.LaunchFileAsync(pdffile);
4

1 回答 1

1

的语法GetFileAsync()

public IAsyncOperation<StorageFile> GetFileAsync(string name)

在哪里

name :要获取的文件的名称(或对于当前文件夹的路径)。

你的字符串是

string file = "Download.txt";

这可能不被接受为相对路径。尝试类似的东西,

string file = @"\Download.txt";
于 2014-11-15T17:04:03.447 回答