How to load local HTML pages in WebBrowser control in C#

Viewed 44805

I have number of local HTML pages. I want to display these local HTML pages in Web browser control. When I add new page it should get append to previous page.

Here is the sample code for the setting Url

for( int i=0; i<=filecount; i++)
    web-browser.Url = new Uri(filepath[i]);

But during run time its showing the File Download pop up and web browser is empty.

3 Answers

I tried:

FileStream source = new FileStream(filepath, FileMode.Open, FileAccess.Read);
webBrowser1.DocumentStream = source;

I had to add this also:

webBrowser1.DocumentStream.Close();
Related