如何使用桌面应用程序来处理Windows服务 [英] how to intract windows service with desktop application

查看:98
本文介绍了如何使用桌面应用程序来处理Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个Windows服务,它完美地运行背景。但我想用另一个桌面应用程序。我知道这是坏habbit becoz Windows服务是为了只在后台运行,但我需要使用desktop.i搜索这个但不解决我的问题。

note - 我在Windows服务的exe文件中尝试不是调试模式。



请帮帮我...





提前感谢....

i create a windows service and it run background perfectly. but i want to intract with another desktop application.i know this is bad habbit becoz windows service is made for only run in background but i need to work with desktop.i searched for this but not solve my problem.
note - i trying in exe file of windows service not debug mode.

please help me...


thanks in advance....

推荐答案

如果您的服务需要与桌面互动应用程序然后你的架构是有缺陷的。如果您的服务需要支持或提供交互,那么它通过暴露某种接口来实现这一点。它可以托管WCF服务,或者它可以侦听TCP / IP端口上的命令,然后客户端应用程序以这种方式与服务进行通信。这就是每个其他Windows服务的工作方式,也是您的工作方式。您可能需要更多地解释一下您正在尝试实现的目标。
If your service needs to interact with desktop apps then your architecture is flawed. If your service requires to support or provide interaction then it does this by exposing some kind of interface. It could host a WCF service, or it could listen for commands on a TCP/IP port, and the client apps then communicate with service that way. That is how every other Windows Service works and it is how yours should work too. You might need to explain a bit more about what it is you're trying to achieve.


这篇关于如何使用桌面应用程序来处理Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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