Windows应用程序到Windows服务 [英] Windows application to Windows Service

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

问题描述



我想将我的.exe Windows应用程序转换为Windows服务.它通过Sql通知服务起作用,即,如果Table程序中有一个条目,它将获取该条目.它具有一个begin invoke委托,因此Windows服务将不支持它.


在此先感谢
Anvas

Hi,

I want to covert my .exe windows application to windows service. It works by Sql notification service, ie if an entry comes to Table program will fetch that entry. it has a begin invoke delegate so it wont support by windows service.


Thanks in advance
Anvas

推荐答案

如果您抛弃所有与System.Windows.Forms相关的代码,可以这样做.如果您的UI与其他所有对象都很好隔离,那么这很容易.如果不是,请尝试提取纯应用程序逻辑,数据处理等,所有与UI无关的内容.如果这很困难,则最好使用可用的应用程序作为参考从头开始.下次再仔细考虑一下不同应用程序层的隔离.

Windows服务本身的开发有许多特殊的考虑因素和困难,尤其是在测试/调试中.

从这里开始:
http://en.wikipedia.org/wiki/Windows_service [ http://msdn.microsoft.com/en-us/library/d56de412%28v = vs.100%29.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/y817hyb6.aspx [ ^ ].

—SA
If can do it if you throw out all code related to System.Windows.Forms. If your UI is well isolated from everything else, this is easy. If not, try to extract pure application logic, data processing, etc., everything not related to UI. If this is difficult, you better start from scratch, using your available application as a reference. Next time think thoroughly about isolation of different application layers.

Development of a Windows Service itself has a number of special considerations and difficulties, especially in testing/debugging.

Start here:
http://en.wikipedia.org/wiki/Windows_service[^],
http://msdn.microsoft.com/en-us/library/d56de412%28v=vs.100%29.aspx[^],
http://msdn.microsoft.com/en-us/library/y817hyb6.aspx[^].

—SA


非常简单,请参阅此处的答案
http://social.msdn.microsoft.com/论坛/en-IE/clr/thread/e2993f62-8ea2-493d-9b62-62b3dc603052 [
it''s very simple, See the Answers here
http://social.msdn.microsoft.com/Forums/en-IE/clr/thread/e2993f62-8ea2-493d-9b62-62b3dc603052[^]

Thanks
--RA


很遗憾,UI无法转换为Windows服务.
Unfortunately, UI cannot be converted into a Windows Service.


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

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