tags:

views:

15

answers:

1

Hello, I'm planning to use thw WebBrowser component to display html that is created on the fly. The perfect choice for this is NavigateToString or NavigateToStream methods. There's only one single problem - I need to load images / css styles / js files too. How do I accomplish this while using string/stream?

As an option I'm also considering writing/finding simple http server and running it on some port, but that's an additional work and requirements(open ports) so I'd like to avoid that if it's possible.

A: 

You can cast WebBrowser.Document to IPersistMoniker and load a moniker that implements GetDisplayName. Check http://csexwb2.googlecode.com/svn/trunk/cEXWB.cs for example code.

Sheng Jiang 蒋晟