你服务运行的权限设了吗?在服务代码啦,那个XXXInstaller类里的InitializeComponent()函数里:
objXXXInstaller.StartType=System.ServiceProcess.ServiceStartMode.Automatic;
objXXXProcessInstaller.Account=ServiceAccount.LocalSystem;

解决方案 »

  1.   

    不成功,出什么问题了呀?
    可以从网上找到很多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
      

  2.   

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;842793按照KB 842793的建议,用System.Threading.Timer替换System.Timers.Timer。
      

  3.   

    Combine Web and Windows Services to Run Your ASP.NET Code at Scheduled Intervalshttp://msdn.microsoft.com/msdnmag/issues/05/03/SchedulingASPNETCode/default.aspx