[Help] need help with windows services stopping
heres my code :
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim controller As New ServiceController
controller.MachineName = "."
controller.ServiceName = "Secondary Login"
Dim status As String = controller.Status.ToString '- Error Object reference not set to an instance of an object.
' Stop the service
controller.Stop()
' Start the service
controller.Start()
End Sub
get this error :
Code:
Object reference not set to an instance of an object.
thx

Try this: Dim controller As New Object .
Idk if it works.
What are it supposed to do?