0

I know the service that is running using

ServiceController sc = new ServiceController();
ServiceController.GetServices(DropDownListMachineName.SelectedValue))

but ServiceController does not contain any method or property to get the Description of the service.

Any idea ?

Nathan Taylor
  • 24,423
  • 19
  • 99
  • 156

2 Answers2

0

This MSDN page suggests:

ManagementObject wmiService;
wmiService = new ManagementObject("Win32_Service.Name='" + sc.ServiceName + "'");
wmiService.Get();
Console.WriteLine("    Description:     {0}", wmiService["Description"]);
dommer
  • 19,610
  • 14
  • 75
  • 137
0

See this example:

ServiceController.GetServices Method ()

Devendra D. Chavan
  • 8,871
  • 4
  • 31
  • 35
Paula Bean
  • 458
  • 3
  • 9