Problem Script
Public Class FileTransferAgentService
Protected Overrides Sub OnStart(ByVal args() As String)
Dim FTATimer As System.Threading.Timer
Const timerInterval As Integer = 60000
Dim timerDelegate As Threading.TimerCallback = AddressOf EventAction
FTATimer = New System.Threading.Timer(timerDelegate, Me, timerInterval, timerInterval)
EventLog.WriteEntry("FTA started.")
End Sub
:
:
:
End Class
Solution Script: Delcare the Timer thread as Global to the Class:
Public Class FileTransferAgentService
Dim FTATimer As System.Threading.Timer
Const timerInterval As Integer = 60000
Dim timerDelegate As Threading.TimerCallback = AddressOf EventAction
Protected Overrides Sub OnStart(ByVal args() As String)
FTATimer = New System.Threading.Timer(timerDelegate, Me, timerInterval, timerInterval)
EventLog.WriteEntry("FTA started.")
End Sub
:
:
End Class
Saturday, December 27, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment