G
Guest
Hi all!
I have a Windows service, where I want to use a timer.. But it does not
Seems work?? It does not catch the Timer1.tick event ??? But the code works
on a form???
Can anyone help me, please??
"Onstart" - I set:
Timer1.Interval = 5000
Timer1.Enabled = True
Timer1.Start()
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Dim MyLog As New EventLog ' create a new event log
' Check if the the Event Log Exists
If Not MyLog.SourceExists("Service") Then
MyLog.CreateEventSource("Service", "Service Log") ' Create Log
End If
MyLog.Source = "Service"
' Write to the Log
MyLog.WriteEntry("Service Log", "This is log on " & _
CStr(TimeOfDay), EventLogEntryType.Information)
End Sub
I have a Windows service, where I want to use a timer.. But it does not
Seems work?? It does not catch the Timer1.tick event ??? But the code works
on a form???
Can anyone help me, please??
"Onstart" - I set:
Timer1.Interval = 5000
Timer1.Enabled = True
Timer1.Start()
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Dim MyLog As New EventLog ' create a new event log
' Check if the the Event Log Exists
If Not MyLog.SourceExists("Service") Then
MyLog.CreateEventSource("Service", "Service Log") ' Create Log
End If
MyLog.Source = "Service"
' Write to the Log
MyLog.WriteEntry("Service Log", "This is log on " & _
CStr(TimeOfDay), EventLogEntryType.Information)
End Sub