如何知道某些文件元数据是只读的?

时间:2013-01-15 04:42:28

标签: c# .net windows-runtime windows-store-apps

我可以通过下面的代码将一些EXIF属性存储到jpg图片中。

var propertyToSave = new List<KeyValuePair<string, object>>() { 
    new KeyValuePair<string, object>("System.Photo.LensManufacturer", "Canon") };

await file.Properties.SavePropertiesAsync(propertyToSave);

但实际上列出的here EXIF的某些属性是只读的。

E.g。如果尝试设置只读属性"System.Photo.PeopleNames",则会抛出异常。

// System.Photo.PeopleNames is a read-only property
var propertyToSave = new List<KeyValuePair<string, object>>() { 
    new KeyValuePair<string, object>("System.Photo.PeopleNames","Foo") 
};

ps:值"Foo"可能不是与密钥"System.Photo.PeopleNames"对应的正确值。我只是举个例子。

我的问题是,有没有办法知道某些文件元数据是否是只读的?

1 个答案:

答案 0 :(得分:0)