Stop my service through it's own code?
How does one stop a service through the code itself? I want to check for a valid license, and if it's expired, shut down the service.
Calling this method in OnStart:
VB Code:
Private Sub CheckLicense()
EventLog1.WriteEntry("Your license has expired. Please contact support to obtain a new license.", EventLogEntryType.Error)
Logger.Log("I", Encoding.ASCII.GetBytes("Your license has expired. Please contact support to obtain a new license."))
'Application.Exit()
'OnStop()
Me.Dispose(True)
End Sub
Application.Exit, OnStop and Me.Dispose do not shut it down.
Thanks,
Mike