使用Windows服务的消息 [英] Message using Windows Service

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

问题描述

我想创建Windows服务,该服务应检查数据库消息的当前日期,并应使用Windows服务显示它.
如果有任何类型的代码转发.

解决方案

问题是显示"部分.在低于v6的内核上,设置服务属性允许服务与桌面交互",可以轻松显示服务中的弹出窗口.但是在Vista中,有一个Session 0(运行服务),并且您将无法 [ ^ ]与用户会话进行交互(如果有).
因此,您必须在解决方案中创建两个项目:一个服务和一个需要由用户启动(或在登录时自动启动)的客户端.它将像客户端-服务器体系结构一样工作,但是在同一台机器上.您可以使用几种进程间通信方法,但是 WCF [可以接听电话 [ ^ ]从服务中显示消息.

http://www. aspdotnet-suresh.com/2011/06/creating-windows-service-in-c-or.html [ http://www.c-sharpcorner.com/UploadFile/prvn_131971/BirthdayWishScheduler02022006012557AM /a> [ ^ ]


I want to create windows service which should check database message for current date and should display it using windows service.
If there is any type of code forward it.
thanks in advance.

解决方案

The problem is the "displaying" part. On kernel below v6, setting the service property "Allow service to interact with the desktop", made it easy to show popups from the service. But from Vista, there is a Session 0, where the services run, and you will be not able to[^] interact with the user session (if any).
Thus you have to make two projects in your solution: one service, and a client that needs to be started by the user (or automatically on logon). It will act like a client-server architecture, but on the same machine. You can use several inter-process communication approaches, but WCF[^] is a good one. The client will subscribe to the WCF service on start, and thus can receive calls[^] from service to show the message.


http://www.aspdotnet-suresh.com/2011/06/creating-windows-service-in-c-or.html[^]
http://www.c-sharpcorner.com/UploadFile/prvn_131971/BirthdayWishScheduler02022006012557AM/BirthdayWishScheduler.aspx[^]


这篇关于使用Windows服务的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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