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 に答える