關於webkit.net使用請看這裡http://www.cnblogs.com/linyijia/p/4045333.html
nicedit編輯器請到這裡下載http://www.nicedit.com/download.php
private void Form1_Load(object sender, EventArgs e)
{
string url = String.Format(@"file:\\\{0}nicedit\index.html", AppDomain.CurrentDomain.BaseDirectory);
url = url.Replace("\\", "/").Replace(" ","%20");
webKitBrowser1.Navigate(url);
}
需要把路徑修改一下,空格也要轉碼
以nicedit為例,以下是index.html代碼,裡面新增了兩個方法,getData(取值)、setData(賦值)
<html>
<head>
<title></title>
</head>
<body>webKitBrowser1.StringByEvaluatingJavaScriptFromString("setData('sdfsd')");
取值:
MessageBox.Show(webKitBrowser1.Document.InvokeScriptMethod("getData").ToString());