Jitesh Byahut 2/16/2014 2058

Win32_Registry in WMI C# Asp.Net

Here we are retrieving Registry details of Computer.

Use namespace System.Management

using System.Management;

 

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

{

    protected void Page_Load(object sender, EventArgs e)

    {

   ManagementObjectSearcher objregistry = new ManagementObjectSearcher("select * from Win32_Registry");

 

        foreach (ManagementObject obj in objregistry.Get())

        {

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

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

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

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

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

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

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

        }

    }

}

Demo

View output :

demoimage


Please give your feedback for improving this page