是否有一个通用的 api/库用于读取 C# 中所有已知文件类型的元数据?
我需要阅读&修改上传到我们服务器的文件的元数据。是否有通用 api/库用于读取键值类型交易中的元数据?
这意味着它可能是专有文件,例如 .doc/docx、.xls/xlsx 等。以及免费文件,例如 .rtf、.txt、.jpg
感谢您的所有帮助
I need to read & modify metadata of files uploaded in our server. Is there a generic api/library for reading Metadata in a Key-Value type of deal?
This means that it may be proprietary files such as .doc/docx, .xls/xlsx, etc. And free stuff like .rtf, .txt, .jpg
Thanks for all the help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有任何库可以读取任何语言的“所有已知文件类型”的元数据,因为这几乎是不可能的。
您也许能够找到能够读取特定格式或密切相关格式系列的库,这是最常见的解决方案并且适用于大多数情况。
对于您列出的格式,库确实存在。我认为,JPG 通过某些系统库在 C# 中内置了一些支持。 TXT 是简单文本,大多数语言都支持。 RTF有一些支持,我认为主要是通过RichTextBox控件。对于另外两个,我会研究 Office 的 SDK 或者 Visual Studio 的 Office 开发内容,这些可能有更多信息。
有一个程序,TrID,可以根据数据识别文件格式,这可能有一定的兴趣。它不能进行正确的元数据读取,但它是最接近现有通用文件读取器的东西(据我所知)。
There's no library for reading the metadata of "all known filetypes" in any language, because it's pretty much impossible.
You may be able to find libraries capable of reading a particular format or family of closely-related formats, which is the most common solution and works in most situations.
For the formats you've listed, libraries do exist. JPG has some support built into C#, I think, through some of the System libraries. TXT is simple text, that's supported in most languages. RTF has some support, mainly through the RichTextBox control, I think. For the other two, I would look into Office's SDK or perhaps the Office development stuff for Visual Studio, those might have more information.
There is a program, TrID, that can identify file formats based on their data, which may be of some interest. It doesn't do proper metadata reading, but it is the closest thing to a universal file reader that exists (that I'm aware of).