ChromiumFX中js调用C#方法

时间:2015-06-04 11:56:43   收藏:0   阅读:1492

服务器端代码:


ChromiumWebBrowser wb;

wb.AddGlobalJSFunction("CfxHelloWorld").Execute += CfxHelloWorld_Execute;


void CfxHelloWorld_Execute(object sender, CfrV8HandlerExecuteEventArgs e)
        {
            MessageBox.Show("调用成功!");
        }



JS调用代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title></title>
	</head>
	<body>
    <button onclick="CfxHelloWorld()">点击调用C#</button>
	</body>
</html>


评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!