Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Chromium Web Browser Control in .NET Applications

DZone's Guide to

Chromium Web Browser Control in .NET Applications

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

Do you need to embed a web browser into your .NET application, but the default MS IE-based WebBrowser component does not satisfy your requirements? Are you looking for an easy-to-use and full-featured alternative? In this case DotNetBrowser  is a good choice for you.

DotNetBrowser is a .NET library that gives you a possibility to embed a Chromium-based browser component into your .NET WPF or WinForms applications to display modern web pages built with HTML5, CSS3, JavaScript.

DotNetBrowser has a great documentation that includes the Quick Start Guide , the Knowledge Base with detailed explanations for all possible use-cases, and the API documentation , where all the components and features are well documented.

In the list of samples  you can find code samples that demonstrate how to perform the most common tasks, such as loading a web page from URL, getting the source code of the displayed page, rendering the given HTML code and executing JavaScript code.
The component’s API is rich and easy to use. For example, let's see how easy you can embed a DotNetBrowser component into your WPF application and navigate on the Google web page:

MainWindow.xaml

<Window x:Class="WPF.DotNetBrowser.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid Name="mainLayout">
    </Grid>
</Window>

MainWindow.xaml.cs

using System;
using System.Windows;
using DotNetBrowser;
using DotNetBrowser.WPF;

namespace WPF.DotNetBrowser
{
    public partial class MainWindow : Window
    {
        BrowserView webView;

        public MainWindow()
        {
            Environment.SetEnvironmentVariable("DOTNETBROWSER_BIN_DIR",
                @"D:\Projects\DotNetBrowser-1.0\Library\Chromium");
            InitializeComponent();

            webView = new WPFBrowserView(BrowserFactory.Create());
            mainLayout.Children.Add((UIElement)webView.GetComponent());
            webView.Browser.LoadURL("http://www.google.com");
        }
    }
}

Once you configure  your .NET Visual Studio 2013 project with DotNetBrowser library and run the application, the result will look like given below:

The functionality of DotNetBrowser is not limited to loading and rendering HTML pages. The product’s API allows listening to the browser events, displaying popups, accessing and modifying DOM, managing and executing JavaScript code and even calling .NET methods from Javascript. 

Such capabilities of DotNetBrowser look very promising for any .NET developer who is interested in a solution of that kind.

Bring the power of Chromium engine into your .NET application!

Links:
About library: http://www.teamdev.com/dotnetbrowser
Samples: https://sites.google.com/a/teamdev.com/dotnetbrowser-support/samples

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.

Topics:
java ,dotnet ,enterprise-integration ,.net ,web browser ,wpf ,chromium ,.net c#

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}