1

有没有办法使用 C# 代码在 Windows Phone 8 中打开 .onepkg 文件?

我尝试使用

string imageFile = @"File.onepkg";
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile);
var success = await Windows.System.Launcher.LaunchFileAsync(file);

这是在手机中启动应用程序的默认启动器。

我安装了 OneNote(当我将扩展名从 .onepkg 更改为 .one 时,它​​工作得非常好,并在 windows phone 模拟器中打开 OneNote)。

但是如果是 OneNote 笔记本,它不会打开 OneNote,而是在 windows phone store 中查找,当我说“我接受”时,它会显示“未找到应用程序”

谁能给我任何指示/建议?

4

2 回答 2

2

根据<Extensions>WP8 Onenote 应用程序的元素,当前版本似乎只支持 *.one 和 *.onetoc2 文件扩展名。考虑到 *.onepkg 文件是创建新文件的模板,这是有道理的,但 app2app 文件扩展名支持目前仅限于只读方案。

  <Extensions>
    <FileTypeAssociation
      Name="OneNote file"
      TaskID="Default"
      NavUriFragment="CmdLine=-s &quot;token:%s&quot;">
      <Logos>
        <Logo Size="small" IsRelative="true">OneNoteFileIcon.small.{ScreenResolution}.png</Logo>
        <Logo Size="medium" IsRelative="true">OneNoteFileIcon.medium.{ScreenResolution}.png</Logo>
        <Logo Size="large" IsRelative="true">OneNoteFileIcon.large.{ScreenResolution}.png</Logo>
      </Logos>
      <SupportedFileTypes>
        <FileType ContentType="application/onenote">.one</FileType>
      </SupportedFileTypes>
    </FileTypeAssociation>
    <FileTypeAssociation
      Name="OneNote notebook"
      TaskID="Default"
      NavUriFragment="CmdLine=-s &quot;token:%s&quot;">
      <Logos>
        <Logo Size="small" IsRelative="true">OneNoteNoteBookIcon.small.{ScreenResolution}.png</Logo>
        <Logo Size="medium" IsRelative="true">OneNoteNoteBookIcon.medium.{ScreenResolution}.png</Logo>
        <Logo Size="large" IsRelative="true">OneNoteNoteBookIcon.large.{ScreenResolution}.png</Logo>
      </Logos>
      <SupportedFileTypes>
        <FileType ContentType="application/onenote">.onetoc2</FileType>
      </SupportedFileTypes>
    </FileTypeAssociation>
    <Protocol
      Name="onenote"
      TaskID="Default"
      NavUriFragment="CmdLine=-u &quot;%s&quot;"/>
  </Extensions> 
于 2012-12-19T23:28:05.213 回答
1

我认为 onepkg 是一个包含 .one 和 .onetoc 文件以及目录结构的 zip 文件。所以一种方法可能是展开这个 cab 文件,然后打开它。

类型:驾驶室

方法:LZX

块数:1

卷数:1

于 2012-12-24T20:41:11.703 回答