你服务运行的权限设了吗?在服务代码啦,那个XXXInstaller类里的InitializeComponent()函数里:
objXXXInstaller.StartType=System.ServiceProcess.ServiceStartMode.Automatic;
objXXXProcessInstaller.Account=ServiceAccount.LocalSystem;
objXXXInstaller.StartType=System.ServiceProcess.ServiceStartMode.Automatic;
objXXXProcessInstaller.Account=ServiceAccount.LocalSystem;
可以从网上找到很多Windows服务的例子。
System.Timers.Timer在Windows Services程序中工作不正常的问题解决
http://www.cnblogs.com/ron2k/archive/2005/01/22/95760.html
http://asia.cnet.com/builder/architect/web/0,39009340,39202600,00.htm