: Hello, : : i need to read some BIOS Information with C#. : : I have done some WMI programming with C# before but cannot find any : information on how to read BIOS information. : : I want to use the Win32_BIOS class. : : Can anyone show me how to do this? : : Thank you. :
Comments
i found something.
But now i am getting some Exception.
I will post a separate post for this.
: Hello,
:
: i need to read some BIOS Information with C#.
:
: I have done some WMI programming with C# before but cannot find any
: information on how to read BIOS information.
:
: I want to use the Win32_BIOS class.
:
: Can anyone show me how to do this?
:
: Thank you.
:
// add a reference System.Management.dll
using System.Management;
//this code will display bios name and manufacturer
ObjectQuery objectQuery_BIOS = new ObjectQuery("select * from Win32_BIOS");
ManagementObjectSearcher searcherBIOS = new ManagementObjectSearcher(objectQuery_BIOS);
ManagementObjectCollection valsBIOS = searcherBIOS.Get();
foreach (ManagementObject val in valsBIOS)
{
Console.WriteLine("Name = " + Convert.ToString(val.GetPropertyValue("Name")));
Console.WriteLine("Manufacturer = " + Convert.ToString(val.GetPropertyValue("Manufacturer")));
}
Console.ReadLine();
//......for more properties in Win32_BIOS class check the below link
//http://msdn.microsoft.com/en-us/library/aa394077(v=VS.85).aspx
hope this code helps you.
Thanks and Regards
huawei_1988