无法在Windowsstore app8.1中查看Worddocument / pdf

时间:2016-11-18 11:42:23

标签: c#

我的windows8.1商店应用程序需要从不在Assest中的自定义路径文件夹中以只读格式打开Word文档和pdf文件。 代码

Encoding utf8 = new System.Text.UTF8Encoding(true, true);
            StorageFolder storagefolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            StorageFile storagefile = await storagefolder.GetFileAsync(@"C:\sampledoc\sample_raw.txt");
            var options = new Windows.System.LauncherOptions() { DisplayApplicationPicker = true };
            await Launcher.LaunchFileAsync(storagefile, options);

运行上面的代码时会出现以下错误

类型' System.IO.FileNotFoundException'的异常发生在mscorlib.dll但未在用户代码中处理 附加信息:文件名,目录名或卷标语法不正确。 (HRESULT异常:0x8007007B)

0 个答案:

没有答案