C# 编写Windows服务、部署、启动以及卸载

C# 编写Windows服务、部署、启动以及卸载

1、创建 <Windows服务项目>2、在构造函数中启动    System.Timers.Timer
3、编写代码后,创建其安装程序;ServiceName即<服务名称>
4、安装:C:WindowsMicrosoft.NETFrameworkv4.0.30319InstallUtil.exe  服务exe路径
5、启动:net start <服务名称>
6、卸载:C:WindowsMicrosoft.NETFrameworkv4.0.30319InstallUtil.exe /u  服务exe路径
原文地址:https://www.cnblogs.com/liuwentian/p/3384631.html