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




Reply With Quote