如何使我的winform程序成为Win服务计划? [英] How to make my winform program as Win Service Program ?

查看:99
本文介绍了如何使我的winform程序成为Win服务计划?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让我的winform程序成为Win服务程序?



实际上我需要我的应用程序run.exe将它创建为windows服务并将独立于用户登录,工作背景甚至电脑都没有登录。



如果我在我的电脑上没有登录我的电脑,我的程序将会那个时候还在工作。



这可能吗?

Is there any way to make my winform program as a Win Service Program ?

Actually i need my application run.exe will create it as windows service and will be independent of the user login, working background even the pc is not logged in.

In a word if i On my pc and not login on my pc my program will still work that time.

Is this possible ?

推荐答案

这可能 - 可能 - 但不寻常尝试将WinForms应用程序转换为服务,只是因为WinForms是关于UI的,而Windows服务则没有,也没有UI。如果它需要与用户交互,它必须启动可以交互的单独(非服务)应用程序,并将信息传递回服务。



要转换Winforms应用程序,首先要删除用户界面,看看你还有什么东西! :笑:



如果您尝试这样做以获得无需用户登录即可运行的UI,那么您需要重新考虑,因为这不是路线你需要关注!
It's possible - probably - but unusual to try and convert a WinForms app to a Service, simply because WinForms is all about the UI, and a Windows Service does not and cannot have a UI. If it needs to interact with the user, it has to "kick off" a separate (non-service) application that can interact, and pass the info back to the service.

To convert a Winforms app, first rip out the user interface, and see if you have anything left! :laugh:

If you are trying to do this to get a UI that works without the user logging in, then you need to reconsider, as this is not the route you need to follow!


这篇关于如何使我的winform程序成为Win服务计划?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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