获得在C#.NET扩展文件属性文件属性、NET

2023-09-04 03:45:07 作者:笔尖微凉

我发现这个职位:

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);

链接到的博文通过的罗布桑德斯的