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)