我正在使用 MIME 来确定将用于在 Windows 8.1 应用程序的文档库中打开文件的应用程序。
switch (extension)
{
case "DOCX":
options.ContentType = "application/vnd.ms-word.document.12";
break;
case "EXCEL":
options.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
break;
case "PPT":
options.ContentType = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
break;
case "PDF":
options.ContentType = "application/pdf";
break;
}
await Windows.System.Launcher.LaunchUriAsync(uri, options);
除 pdf 文件外,一切正常。
打开后,Windows 8 会出现有关文件格式问题的错误。
关于 pdf 文件,Windows 8 有什么特别之处吗?
最佳答案
你必须改变最后一行
await Windows.System.Launcher.LaunchUriAsync(new Uri(fileUrl), options);
关于c# - 适用于 Windows 8.1 的 MIME pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26975895/