[Help] need help with windows services stopping

Posts 1–4 of 4 · Page 1 of 1
[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?
Quote Originally Posted by Zoom View Post
Try this: Dim controller As New Object .

Idk if it works.

What are it supposed to do?
i edited it so is shows where i got the error
Never mind..im doing it a different way now. Thanks for tryin to help
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

Talk with us