Jitesh Byahut 2/16/2014 2801

Win32_OperatingSystem in WMI C# Asp.Net

Here we are retrieving Operating System details of Computer.

Use namespace System.Management

using System.Management;

 

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

{

    protected void Page_Load(object sender, EventArgs e)

    {

  ManagementObjectSearcher objos = new ManagementObjectSearcher("select * from Win32_OperatingSystem");

 

        foreach (ManagementObject obj in objos.Get())

        {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Response.Write("Status  -  " + obj["Status"]);

        }

    }

}

Demo

View output :

demoimage


Please give your feedback for improving this page