写入文件元数据Windows Store应用程序



我有以下代码:

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

当前文件的类型是StorageFile。当我试图保存更新的评论值使用SavePropertiesAsync(),它失败了以下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/

任何想法?

谢谢,Jay

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

最新更新