Windows Develop Bookmark and Share   
 index > Windows Forms General > problem with MHT file has been created from local HTML files
 

problem with MHT file has been created from local HTML files

Hi,

I have a problem with file MHT reading.

I have stored the internet site with IE7 as "Webpage, complete (*.htm, *.html)". It store this site at my computer with all images in some external files.

After that I have stored this html and image collection as "Web Archive (*.mht)". The result is complete MHT file with all images inside. Then I have deleted old *.html and *.gif files and work with MHT file only. I can open this MHT file with IE7 without problem - all images are OK.

Now I try to read this MHT file with class System.Windows.Forms.WebBrowser.

this.webBrowser1 = new System.Windows.Forms.WebBrowser();

webBrowser1.Url = new Uri("d:\my_mht_file.mht");

HtmlDocument html_doc = webBrowser1.Document;

Variable html_doc has collection Images, but this collection is empty. I can't receive any images from MHT file.

This problem is linked to creating the MHT file from files (html and gif) have been stored on local computer. This MHT file includes all images with local links and bitmaps.

The question is how can I extract such images from MHT file has been created from local copy of html and gif files?

Thanks

Michaelo1  Tuesday, December 19, 2006 8:28 AM
You are going to have to wait until the web browser is done loading the file before trying to access the Document property. Use the DocumentCompleted event or poll the ReadyState property.
nobugz  Tuesday, December 19, 2006 5:30 PM
You are going to have to wait until the web browser is done loading the file before trying to access the Document property. Use the DocumentCompleted event or poll the ReadyState property.
nobugz  Tuesday, December 19, 2006 5:30 PM

You can use google to search for other answers

Custom Search

More Threads

• Printing An .EPL File to Eltron Thermal Printer
• Synchronizing events.
• ToolStrip problem
• Printing the page from Print Preview Dialog
• PropertyGrid - property text value cannot be deleted using the DELETE key?
• Activex
• StatusStrip ToolTip Position
• Runtime error, File Format is not valid in RichTextBox.LoadFile()
• Getting file download event of web browser
• How to detect video card's infomation?