I am writing a desktop app in VB.Net, and I'd like to include a web browser control to automate certain functions the user might have to perform in the browser. I have to render the page so I do not want to use the webrequest to make direct calls. When I publish the app, do I have to be concerned with which version of Internet Explorer the user has on their machine? Are their any third party, freely available, stable web browser controls available for VB.Net that people are using?
views:
299answers:
3Several versions of Visual Studio support web browser controls. Here is an article on how to implement one.
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx
The web browser control will work with different versions of Internet Explorer, but will be limited to the functionality supported by that version of Internet Explorer.
The article is based on Visual Studio 2008, but in the right corner of the article there are links, on how to use the web browser control, to earlier versions of Visual Studio.
You could always ignore the whole IE issue and use the Mozilla engine embedded in your app:
geckofx
"An open-source component for embedding Mozilla Gecko (Firefox) in .NET applications."
If you embed the Webbrowser control in your application, what you're really doing is embedding a COM object. At runtime, your app will CoCreateInstance() the Webbrowser control, which will load it out of the version of SHDOCVW.DLL or IEFRAME.DLL that is currently on the machine. So, in plain English, you'll be getting the IE6, IE7 or IE8 Webbrowser control, depending on what is installed on the machine.
The practical differences, however, are minimal since the interfaces were published a long time ago and haven't changed over those versions. Differences in terms of different commands that some interfaces (such as IOleCommandTarget) support are abstracted away by the managed layer anyway, so you don't have to worry about that. The biggest difference will be rendering differences, since there is a huge delta in CSS conformance between IE6 and IE8. You'll have to test the various versions using Microsoft's app compat VHDs.
When I worked on the IE team application compatability wrt the Webbrowser control was a huge deal; the team works very hard to make sure that behavior doesn't regress for precisely this scenario—the custom enterprise VB app hosting the WebOC.
Though if you decide to go with an open-source solution to distribute with your app, may I suggest WebKit? Its layout engine is very good and the source code is pretty well maintained and easy to read, though you'll have to write your own managed hosting layer. The Gecko code is much harder to read and debug.