List Windows Services

ShootingStar

Member
Joined
Jul 8, 2005
Messages
5
Programming Experience
3-5
Is there a .net function to return a list of Windows Services installed? I need to be able to search through the list of installed services. I've found the necessary classes for starting and stopping a service but I need some classes that will allow me to discover available Windows Services. Does anyone have any ideas?
 
VB.NET:
Dim services() As System.ServiceProcess.ServiceController = System.ServiceProcess.ServiceController.GetServices(System.Environment.MachineName)
		For intCounter = 0 To services.Length - 1
			lstServices.Items.Add(services(intCounter).ServiceName)
		Next intCounter

this just grabs all the services installed on the current system then lists their names in a listbox (lstServices)
 
Back
Top