Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Protected Overrides Sub OnStart(ByVal args() As String)
- ' Add code here to start your service. This method should set things
- ' in motion so your service can do its work.
- Dim oCallBack As New TimerCallback(AddressOf TimedEvent)
- oTimer = New System.Threading.Timer(oCallBack, Nothing, 300000, 300000)
- EventLog.WriteEntry("CCFinalizeService has begun successfully." , _
- System.Diagnostics.EventLogEntryType.Information)
- End Sub
- Dim now As Date = DateTime.Now
- Dim dueTime As Integer ' milliseconds to the next half-hour
- dueTime = 1800000 - (now.Minute Mod 30) * 60000 - now.Second * 1000 - now.Millisecond
- oTimer = New System.Threading.Timer(oCallBack, Nothing, dueTime, 1800000)
- If Now.Minute <> 0 Or Now.Minute <> 30 Then
- Thread.Sleep((30 - Now.Minute) * 60 * 1000)
- End If
Add Comment
Please, Sign In to add comment