What is the replacement for Application.Run in a Windows Service?
Ken Tucker [MVP] - 21 Nov 2006 15:15 GMT
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
--------------------------------
> What is the replacement for Application.Run in a Windows Service?
Phill W. - 22 Nov 2006 15:22 GMT
> 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.