windows-runtime - 写入文件元数据 Windows 应用商店应用程序

标签 windows-runtime windows-store-apps metadata

我有以下代码:

var props = App.CurrentFile.Properties.GetDocumentPropertiesAsync();
        props.GetResults().Comment = "Comments goes here";
        await props.GetResults().SavePropertiesAsync();

CurrentFile 的类型为 StorageFile。当我尝试使用 SavePropertiesAsync() 保存更新的 Comment 值时,它失败并出现以下 COM 异常。

Error HRESULT E_FAIL has been returned from a call to a COM component.

我在此博客中遵循非常基本的示例:

http://lunarfrog.com/blog/2011/10/17/winrt-wps-part1-storing-retrieving-metadata/

有什么想法吗?

谢谢, 周杰伦

最佳答案

文件格式必须支持元数据。例如,XML 文件不能具有任何属性,但 JPEG 文件可以。

关于windows-runtime - 写入文件元数据 Windows 应用商店应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24572180/

相关文章:

listview - 水平拉伸(stretch)分组 ListView 的项目

c# - 在 WinRT/UWP 中创建自定义虚拟化控件

seo - 如何更改标题和描述等谷歌搜索外观?

android - 如何从图片中获取元数据?

windows-8 - 无法将 Windows 8.1 应用程序部署到 Window 8 设备

c# - 保存的文件有时只包含 NUL 字符

cuda - Windows 8 应用程序中的 GPU 计算 - 适用于 x86 和 ARM

c# - 使用 x :Bind? 时,UpdateSourceTrigger=PropertyChanged 的​​等效项是什么

jsf - 转换错误设置值 "UserID"为 'null Converter'

c++ - 为什么我的 C++/CX 单元测试没有失败?