none
關於Window Service的Timer RRS feed

  • 問題

  • 請問,我用VS2010做了簡單的Window Service測試,但Timer都未發生作用,請問是否有哪裡沒有注意到?
       

     Protected Overrides Sub OnStart(ByVal args() As String)
        EventLog.WriteEntry("Service Start..")
        Timer1.Interval = 60000
        Timer1.Enabled = True
      End Sub
      Protected Overrides Sub OnStop()
        EventLog.WriteEntry("Service Stop..")
      End Sub
      Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        EventLog.WriteEntry("Service Tick..")
      End Sub
    啟動服務後,都沒有tick的訊息產生!
    2010年6月7日 上午 09:26

解答

所有回覆