Windows服务消息问题 [英] windows service mesage problem

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

问题描述

在Windows服务中,启动我的服务后,我收到了消息.这里messagebox.show方法不起作用.还有其他解决方案吗?

In windows service after starting my service i got message. here messagebox.show method not working. is there any other solution?

推荐答案

您不能在Windows服务中使用System.Windows.Forms对象,服务不能将消息作为消息框抛出...日志如果要在事件日志中记录任何信息.
You can not use System.Windows.Forms objects in windows service, a services can not throw messages as message box...log if want to log any information in the event log.


Windows服务并不旨在与用户进行交互,至少不会以您尝试的方式进行.
如果您要弹出消息-我假设您正在与运行服务的机器在同一台计算机上-那么只需编写一个小托盘应用程序,即可接收您的消息并将其显示给您.

最好的问候
Windows services are not meant to interact with the user at least not in the way you''re trying.
If you want pop-up messages - I assume you''re working on the same machine as your service is running on - then just write a small tray application which receives your messages and displays them to you.

Best regards


^ ]


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

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