Application.Run / Windows Service ?

  • Thread starter Thread starter Jay
  • Start date Start date
Hi,

Use tge service controller class

Dim s As System.ServiceProcess.ServiceController

For Each s In System.ServiceProcess.ServiceController.GetServices
If s.ServiceName = "MSSQLSERVER" Then
If s.Status = ServiceProcess.ServiceControllerStatus.Stopped
Then s.Start()
End If
's.Stop to stop
's.Start to start
's.Pause to pause
Next

Ken
 
Jay said:
What is the replacement for Application.Run in a Windows Service?

ServiceBase.Run

Depending on what version of 'Studio you have, you may already have a
Project Template for a Windows Service.

HTH,
Phill W.
 
Back
Top