在哪里查看安装的服务
-
任务管理器
-
右击"我的电脑"->“服务”
如何安装我们的服务程序
安装exe
服务程序,讲白了,也是exe,需要有自己的安装位置
比如我演示的这个Tanovo CollecService
,就是安装在如下目录
安装服务到计算机
我们可以通过以下命令并在具有管理员的cmd窗口中执行
sc.exe create "TanovoCollectService" binPath= "C:\Users\haoze\source\repos\HFGA\CollectService\bin\Release\CollectService.exe" start= auto displayname= "Tanovo CollectService"
参数说明:
- create:这个不用解释了吧???
- binPath:可执行程序的物理位置
- start:启动方式
- displayname:显示的名称,这里和服务名称不一样
具体也可参考微软官网的释义:传送门
如果需要删除服务的话
sc.exe delete "TanovoCollectService"
如果需要调试的话,直接把binPath
换成你的Debug目录