C # WinForm developing nested chrome kernel browser (webkit.net) development (i)

Source: Internet
Author: User

Webkit.net is the. NET package for WebKit,

Using it, the. NET program makes it easy to integrate and use WebKit as a container for loading web pages.

First of all

Download the bin file for webkit.net.

And then

Create a new WindowsForms project.

Then copy all the files in the downloaded Webkit.net bin directory to the bin/debug/directory of the new project.

Add a reference and browse to add a reference to "WebKitBrowser.dll".

Add to the effect later

  

Double-click the Form1 form in the VS project to enter the code and write down these lines of code:

private void Form1_Load (object sender, EventArgs e)        {            Webkit.webkitbrowser browser = new Webkitbrowser ();            Browser. Dock = DockStyle.Fill;            This. Controls.Add (browser);            Browser. Navigate ("http://www.lixin.me");        }

Double-click Enter to write down code

private void Form1_Load (object sender, EventArgs e)
{
Webkit.webkitbrowser browser = new Webkitbrowser ();
Browser. Dock = DockStyle.Fill;
This. Controls.Add (browser);
Browser. Navigate ("http://www.baidu.com");
}

Run results

WebBrowser vs. IE Kernel:

ie use

, such as using System.Windows.Forms.WebBrowser.

Use. NET Framework, it may be simpler to invoke the WebBrowser of the IE kernel to display the Web page.

A few lines of code are written in the new project:

private void Form1_Load (object sender, EventArgs e)        {            WebBrowser browser = new WebBrowser ();            Browser. Dock = DockStyle.Fill;            This. Controls.Add (browser);            Browser. Navigate ("http://www.lixin.me");           }

The effect looks pretty much the same, the naked eye can only see a slightly different font:

But with the IE kernel webbrowser we can not predict the display of the page, for example, your computer is XP, may call IE6 as the loader, if it is Win7, may call IE8 as the loader, and their display effect is not exactly the same.

C # WinForm developing nested chrome kernel browser (webkit.net) development (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.