如何将文件从Assets文件夹导出到手机';s Windows Phone 8.1 RT中的Documents文件

本文关键字:文件 Windows Phone Documents 中的 RT 手机 Assets 文件夹 | 更新日期: 2023-09-27 17:59:52

我正试图使用C#将Assets文件夹中的文件导出到Windows phone 8.1 RT中手机的Documents文件夹中。我已经启用了文档库功能,并且能够访问文档库。但我无法复制文件。

有人吗?

如何将文件从Assets文件夹导出到手机';s Windows Phone 8.1 RT中的Documents文件

我还没有尝试从Assets复制文件,但我可以将文件写入手机的Documents文件夹,好吧:

var myFolder = KnownFolders.DocumentsLibrary;
var myFile = await myFolder.CreateFileAsync("test.txt", CreationCollisionOption.OpenIfExists);
await FileIO.WriteTextAsync(myFile, "hello world");

清单中是否有正确的文件类型关联?应该是这样的:

<Extension Category="windows.fileTypeAssociation">
  <FileTypeAssociation Name="txt">
    <DisplayName>txt</DisplayName>
      <SupportedFileTypes>
        <FileType>.txt</FileType>
      </SupportedFileTypes>
  </FileTypeAssociation>
</Extension>