从Web表单的WinForms发送数据 [英] Send data from web form to winforms
问题描述
您好,我有开发在即时通讯能够从我的Web窗体从WinForm的发送一些数据(通知)窗口形式类似于Web窗体应用程序。
Hello i have to develop an application in which im able to send some data(notification) from my webform to windows form and similarly from winform to webform.
有人告诉我,我必须使用Web服务实现此目的。所以,如果有人请告诉我,我该怎么办呢?
Someone told me that i have to use web service for this purpose. so if someone please tell me how can i do that?
林。
推荐答案
从Web表单的一般模式 - >赢形式:
The general pattern from Web forms -> Win forms:
- 添加一个WCF服务,让您赢窗体应用程序。
- 实现的接口。
- 使用一个ServiceHost的,并在初始化code某处启动该服务。
- 启动赢形式的项目。
- 在您的网页形式的项目,选择引用 - >添加服务引用 。
- 输入的表单应用程序的配置文件的URL。 (当你创建服务这是加的)服务应该被发现和代理code自动生成。
- 重新构建Web表单项目,你应该有机会获得胜利形成服务方法。
在其他方向上的服务是相似的,但你并不需要一个ServiceHost的实现(IIS将自动承载服务)
Services in the other direction are similar, but you don't need a ServiceHost implementation (IIS will host the service automatically)
您可能会想更多的配置为好。可能不同的绑定,和安全性。
You'll probably want further configuration as well. Possibly different bindings, and security.
这篇关于从Web表单的WinForms发送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!