Code for listing Running WindowServices

Vpramodg
Posted by Vpramodg under Others category on | Points: 40 | Views : 2010
The List of Running WindowServices added to the ListBox Control.

NameSpace Using for this.

using System.ServiceProcess;


Here is the Code.

 ServiceController[] objServices;
objServices = ServiceController.GetServices();

foreach (ServiceController x in objServices)
{

if (x.Status == ServiceControllerStatus.Running)
{
listBoxRunningWindowService.Items.Add(x.DisplayName.ToString());
}

}


pramod.v.g

Comments or Responses

Login to post response