ManagementObjectSearcher query1 = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem");

ManagementObjectCollection queryCollection1 = query1.Get();

foreach (ManagementObject mo in queryCollection1)

{

label9.Text = "Operating System : " + mo["name"].ToString();

label10.Text = "OS Version : " + mo["version"].ToString();

label11.Text = "OS Manufacturer : " + mo["Manufacturer"].ToString();

}

query1 = new ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem");

queryCollection1 = query1.Get();

foreach (ManagementObject mo in queryCollection1)

{

label12.Text = "System Manufacturer : " + mo["manufacturer"].ToString();

label13.Text = "System Model : " + mo["model"].ToString();

label14.Text = "System Type : " + mo["systemtype"].ToString();

label15.Text = "Physical Memory (RAM): " + (long.Parse(mo["totalphysicalmemory"].ToString()) / 1048576).ToString("###,###.##") + " MB";

}

query1 = new ManagementObjectSearcher("SELECT * FROM Win32_processor");

queryCollection1 = query1.Get();

foreach (ManagementObject mo in queryCollection1)

{

label16.Text = "Processor : " + mo["caption"].ToString();

}

query1 = new ManagementObjectSearcher("SELECT * FROM Win32_bios");

queryCollection1 = query1.Get();

foreach (ManagementObject mo in queryCollection1)

{

label17.Text = "Version : " + mo["version"].ToString();

}

query1 = new ManagementObjectSearcher("SELECT * FROM Win32_timezone");

queryCollection1 = query1.Get();

foreach (ManagementObject mo in queryCollection1)

{

label18.Text = "Time Zone : " + mo["caption"].ToString();

}

query1 = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = ‘TRUE’");

queryCollection1 = query1.Get();

foreach (ManagementObject mo in queryCollection1)

{

label19.Text = "Network Card : " + mo["Description"].ToString();

}

Advertisements