我如何从文件属性的细节? [英] How do I get details from File Properties?

查看:127
本文介绍了我如何从文件属性的细节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
读/写'扩展'文件属性(C#)

有谁知道如何获得包含在信息详情的一个文件的属性窗口的标签? ?我俯瞰任何.NET库

Does anyone know how to get the information contained in the Details tab of a File's properties window? Any .NET library I'm overlooking?

这是窗口/信息我说的:

This is the window/information I'm talking about:

好像会有更好的方式来访问这些数据,而不必使用各种方法提取各种文件类型的元数据,因为肯定有关于这个信息的标签下的类别有些重叠,甚至是不同的文件类型。但搜索,因为我可能,我还没有碰到过任何想任何(或多个)文件类型做到这一点来 - 相当多的讨论上,虽然抓住了特定的文件类型的元数据

It seems like there would be a better way to access these data rather than having to employ various methods to extract metadata of various file types, since there's certainly some overlap on the categories of information available under this tab, even for different file types. But search as I might, I haven't come across anyone wanting to do this for any (or many) file types -- quite a few discussions on grabbing metadata for specific file types though.

你可能会非常欢迎任何建议:)

Any suggestions you may have would be most welcome :)

推荐答案

好吧,这不是完全不可能的。你需要的PInvoke SHCreateItemFromParsingName()来获得IShellItem2接口指针,所以你可以调用它的getProperty()方法。为了得到这个要在C#然而相当残酷。外壳接口在本地C ++,在其中你可以得到你需要把这个好下场的COM声明和GUID的唯一语言的域名。 .NET后的4个主要版本中,我们还是没有接近使shell编程在托管语言变得更容易。好的关键字谷歌的,虽然,有人的地方做这项工作。

Well, this is not completely impossible. You need to pinvoke SHCreateItemFromParsingName() to obtain an IShellItem2 interface pointer so you can call its GetProperty() method. To get this going in C# is however quite brutal. The shell interfaces are in the domain of native C++, the only language in which you can get the COM declarations and guids you need to bring this to a good end. After 4 major releases of .NET, we're still no closer to make shell programming in a managed language any easier. Good keywords to google for though, somebody somewhere made this work.

这篇关于我如何从文件属性的细节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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