ServiceController1控件
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim ArraySrvCtrl() As ServiceController
Dim tempSC As ServiceController
Try
ArraySrvCtrl = ServiceController.GetServices(System.Environment.MachineName)
'在ArraySrvCtrl数组中存储所有服务
For Each tempSC In ArraySrvCtrl
Me.ListBox1.Items.Add("名称:" & tempSC.ServiceName & "...... 状态:" & tempSC.Status.ToString)
Next
Catch
End Try
End Sub