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

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

1、创建 <Windows服务项目>2、在构造函数中启动    System.Timers.Timer
3、编写代码后,创建其安装程序;ServiceName即<服务名称>
4、安装:C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe  服务exe路径
5、启动:net start <服务名称>
6、卸载:C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /u  服务exe路径

 

posted @ 2013-10-23 17:37  刘文天  阅读(369)  评论(0编辑  收藏  举报