[英]How to communicate to a client side application with silverlight
I'm currently developing a silverlight application with prism. 我目前正在开发带有棱镜的Silverlight应用程序。 From this application I need to be able to send a command or keystrokes to a client-side application.
从这个应用程序中,我需要能够向客户端应用程序发送命令或击键。 What is the best way to accomplish this?
做到这一点的最佳方法是什么?
Things I'm considering: 我正在考虑的事情:
Javascript can use an ActiveX object to use DDE. Javascript可以使用ActiveX对象来使用DDE。 (Limits to IE only)
(仅限于IE)
Javascript can interact with a java applet to use DDE. Javascript可以与Java Applet交互以使用DDE。 (Have to deal with signing the applet appropriately)
(必须适当处理小程序的签名)
Silverlight 4 can access COM objects if running Out of Browser. 如果在浏览器中用完,Silverlight 4可以访问COM对象。 (I would like to avoid running out of browser)
(我想避免浏览器用完)
Are there any other options that I am overlooking? 我还有其他选择吗?
In addition to the other suggestions, if you use something like Firebreath to develop the sort of ActiveX control you mention above, you get an effectively identical NPAPI interface for your control for free. 除了其他建议,如果您使用Firebreath之类的工具来开发上述ActiveX控件,则可以免费获得控件的有效相同NPAPI接口。 This would allow you to create one control in native (C++) code that would then work across all major browsers;
这样一来,您就可以使用本机(C ++)代码创建一个控件,然后该控件即可在所有主流浏览器上运行; and you could then talk to that control from Silverlight via its JavaScript bridge.
然后您可以通过Silverlight通过其JavaScript桥与该控件进行对话。 Of course, any application that depends on sending keystrokes to another application is going to be pretty brittle, so you'll have to design your interface pretty well to ensure that things don't go suddenly haywire on you when the other application you're controlling hiccups.
当然,依赖于向另一个应用程序发送击键的任何应用程序都将非常脆弱,因此您必须很好地设计界面,以确保在您使用另一个应用程序时不会突然陷入困境控制打ic。
这太过分了,但是如果客户端应用程序在您的控制之下,则您可以托管一个小的http容器并从Silverlight将其发布到localhost:port :)
Try using a WCF Duplex service 尝试使用WCF双工服务
Pushing Data to Silverlight from WCF Duplex Service 从WCF双工服务将数据推送到Silverlight
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.