adsense

Friday, April 27, 2018

Programmatically Stop a Windows Service (Vb.Net)


You can easily start/stop a windows service using the following code snippet.


Dim service As ServiceController = New ServiceController("Service Name")
        If (service.Status.Equals(ServiceControllerStatus.Running)) Then
            service.Stop()
        End If



Cheers,
Samitha

No comments:

Post a Comment