Jitesh Byahut 2/16/2014 3594

Win32_ComputerSystem in WMI C# Asp.Net

Here we are retrieving Computer System details of Computer.

Use namespace System.Management

using System.Management;

 

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

{

    protected void Page_Load(object sender, EventArgs e)

    {

 ManagementObjectSearcher search1 = new ManagementObjectSearcher("select * from win32_ComputerSystem");

 

        foreach (ManagementObject obj in search1.Get())

        {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        }

    }

}

Demo

View output :

demoimage


Please give your feedback for improving this page