Jitesh Byahut 2/16/2014 2271

Win32_Service in WMI C# Asp.Net

Here we are retrieving Services details of Computer.

Use namespace System.Management

Use namespace System.Management

using System.Management;

 

public partial class WMI_Win32_Service : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

    ManagementObjectSearcher objservices = new ManagementObjectSearcher("select * from Win32_Service");

 

        foreach (ManagementObject obj in objservices.Get())

        {

            Response.Write("Name     -   " + obj["Name"] + "</br>");

            Response.Write("DisplayName - " + obj["DisplayName"] + "</br>");

            Response.Write("StartMode   -  " + obj["StartMode"] + "</br>");

            Response.Write("StartName  -    " + obj["StartName"] + "</br>");

            Response.Write("Started - " + obj["Started"] + "</br></br>");

        }

    }

}

Demo

View output :

demoimage


Please give your feedback for improving this page