获得在C#.NET扩展文件属性 [英] Getting Extended File Properties in C# .net

查看:397
本文介绍了获得在C#.NET扩展文件属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现这个职位:

<一个href="http://stackoverflow.com/questions/220097/read-write-extended-file-properties-c/2096315#2096315">Read/Write 扩展文件属性(C#)

这解释了如何取得.NET扩展文件属性。但它指向code项目文章,是10岁。

That explains how to get extended file properties in .net. But it points to a Code Project article that is 10 years old.

线程本身是5岁。

现在是否有更好的方法来得到这样的标题,副标题,集扩展文件属性名称等等?

Is there a better way now to get extended file properties like Title, SubTitle, Episode Name etc. ?

我真的很想做的是让对单个文件的扩展文件的信息。它看起来对我来说,通过这个目录code环,并得到这些文件的文件信息。

What I would really like to do is to get the extended file information on individual files. It looks to me like this code loops through a directory and gets the file info on those files.

推荐答案

我已经用在 Windows API的code包

ShellObject picture = ShellObject.FromParsingName(file);

var camera = picture.Properties.GetProperty(SystemProperties.System.Photo.CameraModel);
newItem.CameraModel = GetValue(camera, String.Empty, String.Empty);

var company = picture.Properties.GetProperty(SystemProperties.System.Photo.CameraManufacturer);
newItem.CameraMaker = GetValue(company, String.Empty, String.Empty);

<一个href="http://sanderstechnology.com/2013/extracting-file-metadata-with-c-and-the-net-framework/12679/#.U9Eb6Kh_u3I"相对=nofollow>链接到的博文通过的罗布桑德斯

这篇关于获得在C#.NET扩展文件属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆