Jitesh Byahut 2/16/2014 2032

Win32_CDROMDrive in WMI C# Asp.Net

Here we are retrieving CDROM Drive details of Computer.

Use namespace System.Management

using System.Management;

 

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

{

    protected void Page_Load(object sender, EventArgs e)

    {

    ManagementObjectSearcher objcdrom = new ManagementObjectSearcher("select * from Win32_CDROMDrive");

 

        foreach (ManagementObject obj in objcdrom.Get())

        {           

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

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

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

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

        }

    }

}



Please give your feedback for improving this page