如何在C#中调用窗口表单并获取对窗口服务的响应 [英] How to call window form and get response to window service in C#

查看:64
本文介绍了如何在C#中调用窗口表单并获取对窗口服务的响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自动更新程序,它是C#中的窗口服务。我还有自动更新程序客户端,它是窗口应用程序,用于向最终用户显示信息,如果打开任何应用程序并且自动更新程序正在对打开的应用程序执行操作。



先谢谢。





谢谢&此致,

迪帕克库马尔



我的尝试:



我在想。



我的客户端应用程序是握手服务然后与其他人沟通。

和我的客户应用程序正在使用专用用户帐户运行并且服务正在使用系统帐户运行。

I have an auto updater that is a window service in C#. and I also have auto updater client that is window application and that is used to display information to the end user if any application is opened and auto updater is doing an action on opened application.

Thanks in Advance.


Thanks & Regards,
Deepak Kumar

What I have tried:

I was thinking.

my client application is handshakes with service and then communicate either other.
and My client application is running with dedicated user account. and service is running with system account.

推荐答案

您需要与服务建立create 全双工通信,以接收从服务推送通知(更新)。为此,该服务应具有适当的客户端层协议。看起来您需要实现发布者 - 订阅者模型:首先,您的客户端应用程序向服务发送请求,然后服务回复。要订阅,客户端部分使用连接信息向服务发送适当的命令;该服务连接到客户端部分(此特定客户端),并在新数据准备就绪时开始发送通知。请参阅:

Duplex(电信) - 维基百科,免费的百科全书 [< a href =https://en.wikipedia.org/wiki/Duplex_(telecommunications)target =_ blanktitle =New Window> ^ ],

应用层 - 维基百科,免费的百科全书 [ ^ ],

推送技术 - 维基百科,免费的百科全书 [ ^ ],

另见我过去的回答:网站的应用程序'仪表板'帐户 [ ^ ]。



您可以在原始套接字的不同级别实现它到WCF。

另请参阅:双工服务 [ ^ ]。



这些CodeProject文章非常有用:

发布者/订阅者模型的WCF实现 [ ^ ],

WCF中的Duplex服务 [ ^ ],

双面WCF初学者指南 [ ^ ]。



-SA
You need to establish create full-duplex communication with the service, to receive push notification (updates) from the service. For that purpose, the service should have appropriate client-layer protocol. It looks like you need to implement publisher-subscriber model: first, your client application sends request to the service, and the service replies. To subscribe, the client part sends appropriate command to the service, with connection information; the service connects to client part (this particular client) and start sending notifications as new data is ready. Please see:
Duplex (telecommunications) — Wikipedia, the free encyclopedia[^],
Application layer — Wikipedia, the free encyclopedia[^],
Push technology — Wikipedia, the free encyclopedia[^],
see also my past answer: Application 'dashboard' for website accounts[^].

You can implement it on different levels, from raw sockets to WCF.
See also: Duplex Services[^].

These CodeProject article can be useful:
WCF Implementation of the Publisher/Subscriber Model[^],
Duplex Service in WCF[^],
A Beginner's Guide to Duplex WCF[^].

—SA


这篇关于如何在C#中调用窗口表单并获取对窗口服务的响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆