开发者

How to send string messages from a visual c# form application to a webpage

开发者 https://www.devze.com 2023-03-04 18:48 出处:网络
I have a c# windows form application with a webkit.net embedded. Now I was wondering if I can somehow send a string message to the webpage that the application opened.

I have a c# windows form application with a webkit.net embedded. Now I was wondering if I can somehow send a string message to the webpage that the application opened.

My application is basically a simple browser, I'm hoping to have a button that sends text to the opened webpage to start some JavaScript (just like how cross domain postMessage works). The ta开发者_高级运维rget page already has the needed eventlistener.

Thanks in advance.


you can use Watin to drive web browser user gestures, such as typing, clicking, etc. http://watin.org/


I took a look at the WebKit.NET sources and this should be straightforward. Your WebKitBrowser user control has a property called Document - it has a method called InvokeScriptMethod(). It should be as simple as calling it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号