Home All Groups Group Topic Archive Search About

Application.Run / Windows Service ?

Author
21 Nov 2006 3:00 PM
Jay
What is the replacement for Application.Run in a Windows Service?

Author
21 Nov 2006 3:15 PM
Ken Tucker [MVP]
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
--------------------------------

Show quoteHide quote
"Jay" wrote:

> What is the replacement for Application.Run in a Windows Service?
>
>
Author
22 Nov 2006 3:22 PM
Phill W.
Jay wrote:
> 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.