c# 服务

C# 创建Windows服务。服务功能:定时操作数据库

StartType选择Manual手动,Automatic开机自动

 

 

安装,卸载

cd C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319

InstallUtil "D:\C#\废钢服务\SCPMGTService\bin\Debug\SCPMGTService.exe"

InstallUtil  /u "D:\C#\废钢服务\SCPMGTService\bin\Debug\SCPMGTService.exe"

 

问题

在windows 安装服务报异常:System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志。不可 访问的日志: Security

方法:以管理员身份运行命令提示符即可

posted on 2019-05-09 09:43  michellexiaoqi  阅读(222)  评论(0)    收藏  举报