Colleagues, I have a client-server application. Within the server, I've created a Windows service that uses an ODBC connection via a DSN.
Sometimes when I check the server, I see that the Windows service is stopped.
How can I check this Windows service from my client application so it can be started?
I have this code in Vb.Net, but it only works locally on the server.
Dim sc As New ServiceController("ServicioBD")
If sc.Status = ServiceControllerStatus.Running Then
MessageBox.Show("Service Running" + sc.ServiceName)
Else
MessageBox.Show("Service Not Running" + sc.ServiceName)
End If
sc.Dispose()
I would greatly appreciate any help you can give me.