如何从文件属性获取详细信息?
可能的重复:
读/写“扩展”文件属性 (C#)
有谁知道如何获取文件属性窗口的详细信息选项卡中包含的信息?我忽略了任何 .NET 库吗?
这是我正在谈论的窗口/信息:
似乎有更好的方法来访问这些数据,而不必采用各种方法来提取各种文件类型的元数据,因为此选项卡下可用的信息类别肯定存在一些重叠,即使对于不同的文件类型也是如此。但尽管我进行了搜索,但我还没有遇到任何人想要对任何(或许多)文件类型执行此操作——尽管有很多关于获取特定文件类型的元数据的讨论。
如果您有任何建议,我们将非常欢迎:)
Possible Duplicate:
Read/Write 'Extended' file properties (C#)
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 :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,这并非完全不可能。您需要调用 SHCreateItemFromParsingName() 来获取 IShellItem2 接口指针,以便可以调用其 GetProperty() 方法。然而,要在 C# 中实现这一点是相当残酷的。 shell 接口属于本机 C++ 领域,这是您可以获取实现这一目标所需的 COM 声明和指南的唯一语言。在 .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.