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:
  1. Private Sub CheckLicense()
  2.         EventLog1.WriteEntry("Your license has expired. Please contact support to obtain a new license.", EventLogEntryType.Error)
  3.         Logger.Log("I", Encoding.ASCII.GetBytes("Your license has expired. Please contact support to obtain a new license."))
  4.         'Application.Exit()
  5.         'OnStop()
  6.         Me.Dispose(True)
  7.     End Sub

Application.Exit, OnStop and Me.Dispose do not shut it down.

Thanks,
Mike