C#如何安装Windows Service服务

一、将Windows Service生成后,在bin》Debug文件下找到EmailService.exe文件,复制路径;

二、新建Install.bat文件,输入:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /install "F:\HONG\Project\APIImport\EmailService\bin\Debug\EmailService.exe"
pause

更换相应的EmailService.exe文件路径,如下图所示,保存并【以管理员身份运行】完成安装;

 

三、最后,在开始【运行】中键入services.msc打开服务,可查看到已安装的EmailService.exe服务。

 

posted @ 2018-03-26 15:50  苹果的味道_Echo  阅读(485)  评论(0编辑  收藏  举报