3

Hi,

I am using the basic WebBrowser in the .NET framework but have notice that If I use this to brows for example www.stackoverflow.com, then when opening IE7 I can find that I have been visiting the stackoverflow?

I need the WebBrowser to disable this log/history, is it possible? Or is there another Browser control I should look at?

BestRegards

Banshee
  • 15,376
  • 38
  • 128
  • 219

1 Answers1

2

I don't think that's easily possible with the standard WebBrowser control, as it's too tied in with IE. Depending on how you're using it, you could get around it by not actually navigating to a page but sending HTML directly to DocumentText instead though.

Editing the registry HKEY_CURRENT_USER > Software > Microsoft > Internet Explorer > TypedURLs may work too, although I doubt that's good practice and could ended up causing more problems than you solve if something goes wrong.

Or you could try webkitdotnet.sourceforge.net for an alternative WebBrowser control.

Michael Low
  • 24,276
  • 16
  • 82
  • 119
  • For WPF you could use http://chriscavanagh.wordpress.com/2010/10/04/a-real-net-4-0-webbrowser/ . Just wanted to mention it although you clearly need a Winform solution. Hosting WPF in winforms is possible using element host though. A quick sample : http://nayyeri.net/host-wpf-controls-in-windows-forms – basarat Nov 24 '10 at 11:17
  • Thanks, The problem with the webkitdotnet.sourceforge.net and the WPF solution could be that the page is not rendered properly. There is also a risk that thay will not be uptodate when new standard like HTML5 is released. Is there a example how to send HTML direcly to a documentText and then to the browser? – Banshee Nov 24 '10 at 13:01
  • DocumentText is a property of the WebBrowser control, so you can use it with something like 'this.WebBrowser.DocumentText = "my html here";' in your form. Whether that's useful to you depends on exactly how you're using the control - if you're dynamically generating the HTML it'll work without adding to the history, but not if you just want to let users browse with it for instance. As for Webkit and updates, I think any version will be considerably more HTML5 compliant than IE7 is! There may be other problems with it though, I haven't tested it enough personally to know much more. – Michael Low Nov 24 '10 at 16:10