ChromiumFX中js调用C#方法

来源:互联网 发布:软件系统解决方案ppt 编辑:程序博客网 时间:2024/05/18 21:48

服务器端代码:


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 0
原创粉丝点击