在服务里做了一个时钟,用于定期检查某个目录。但这个时钟却启动不起来。
SynergyWindowsServer.TimSystem = New System.Timers.Timer()
CType(SynergyWindowsServer.TimSystem, System.ComponentModel.ISupportInitialize).BeginInit()
SynergyWindowsServer.TimSystem.Interval = 60000.0R '// 1分钟= 1000毫秒 * 60
SynergyWindowsServer.TimSystem.Enabled = True
SynergyWindowsServer.TimSystem.AutoReset = True
CType(SynergyWindowsServer.TimSystem, System.ComponentModel.ISupportInitialize).EndInit()
SynergyWindowsServer.TimSystem.Start()
------解决方案--------------------

------解决方案--------------------
呵呵
因为System.Timers是给Form用的,在windows service里不工作。