Extract content from an MHT document

Does anyone know of any libraries for working with MHT files ( Multiuser MIME files ) in .NET? I need to programmatically extract the content from an existing MHT file containing the Flash website. I could not find such libraries.

Also, if there is a native .NET method that I don’t know about, please let me know.

EDIT: I know that the MailMessage class supports multithreaded MIME messages through the AlternateViews Property . The AlternateView class represents alternative views in a multi-part MIME message. I would like to believe that you can use this knowledge to create something using code native to the .NET platform. I just could not find the right combination to make it work, so I'm starting to lose faith. Does anyone know if it is possible to extract the contents of an MHT file through AlternateView and other related classes? For example, it would be nice if you could create an instance of the MailMessage class from Stream.

+2
source share
3 answers

github. , mhtml, HTML. dll HTMLAgility pack mhtml David:

string filePath = @"D:\Temp\myfile.mhtml";
var doc = new HtmlDocument();
doc.Load(filePath);
string mhtml = doc.DocumentNode.OuterHtml;
MHTMLParser parser = new MHTMLParser(mhtml);
string htmlContent = parser.getHTMLText();
System.IO.File.WriteAllText(@"D:\Temp\file.html", htmlContent);

, - . Vaqar

0

All Articles