从 MHT 文档中提取内容
是否有人知道任何用于处理 MHT 文件的库(多部分 MIME 文件)在.NET 中? 我需要以编程方式从包含 Flash 网站的现有 MHT 文件中提取内容。 我无法找到任何此类库。
另外,如果 .NET 中有我不知道的本机方式,请随时告诉我。
编辑:我知道MailMessage 类通过 AlternateViews 属性。 AlternateView 类表示多部分 MIME 消息。 我相信可以利用这些知识来使用 .NET 框架的原生代码构建一些东西。 我只是一直没能找到合适的组合来让它发挥作用,所以我开始失去信心。 有谁知道是否可以通过 AlternateView 和其他相关类提取 MHT 文件的内容? 例如,如果可以从 Stream 创建 MailMessage 类的实例,那就太好了。
Is anybody aware of any libraries for working with MHT files (Multi-Part MIME files) in .NET? I need to programmatically extract the contents from an existing MHT file containing a Flash website. I haven't been able to locate any such libraries.
Also, if there's a native way in .NET that I'm not aware of, please feel free to let me know.
EDIT: I know that the MailMessage class supports multi-part MIME messages through the AlternateViews property. The AlternateView class represents the alternative views in a multi-part MIME message. I'd like to believe that it's possible to use this knowledge to build something using code native to the .NET framework. I just haven't been able to find out the right combination to make it work, so I'm starting to loose faith. Does anybody out there know if it's possible to extract the contents of a MHT file through the AlternateView and other related classes? For example, it would be nice if it were possible to create an instance of the MailMessage class from a Stream.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可能对我在 github 上的 MIME 解析项目(用 C# 编写)
https://github.com/smithimage/ 感兴趣MIMER/
还有一个 Nuget 包:
https://nuget.org/packages/MIMER/
You might be interessed in my MIME parsing project at github (written in C#)
https://github.com/smithimage/MIMER/
Also has a Nuget package:
https://nuget.org/packages/MIMER/
http://www.lumisoft.ee/lswww/ ENG/Products/Mail_Server/mail_index_eng.aspx?type=info
这是开源电子邮件服务器,具有良好的 Mime 解析器。
http://www.lumisoft.ee/lswww/ENG/Products/Mail_Server/mail_index_eng.aspx?type=info
This is open source email server which has good Mime Parser.
David Benko 这里他的 github 项目做得很好。 我最近遇到了一个问题,我有一个 mhtml 需要转换为 HTML 文件。 为此,我使用 HTMLAgility pack dll 从 mhtml 文件中提取内容,并将这些内容提供给 David 提供的库:
如果有人可以验证这种方法,我将非常感激。
干杯
瓦卡尔
David benko did a great job here his github project. I recently faced a this issue where I had an mhtml that needed to be converted to HTML file. for that I used HTMLAgility pack dll to extract content from the mhtml file and feed in this content to David's provided library:
I would really appreciate if someone could verify this approach.
Cheers
Vaqar