Windows服务 - 如何设置自动启动&自动停止? [英] Windows Service - How to setup auto-start & auto-stop?

查看:94
本文介绍了Windows服务 - 如何设置自动启动&自动停止?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows服务 - 如何设置自动启动和自动停止?它似乎无法通过窗口服务属性向导进行设置。有没有办法设置自动启动和自动停止(例如以编程方式使用一段C#代码)?在此先感谢。

Windows Service - How to setup auto-start & auto-stop? It looks to be it can't setup through Window Service Properties Wizard. Is there a way to setup auto-start & auto-stop (e.g. programmatically using a piece of C# code)? Thanks in advance.

推荐答案

在项目安装程序中,设置ServiceInstaller的属性。
In your project installer, set the property of your ServiceInstaller.


这篇关于Windows服务 - 如何设置自动启动&自动停止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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