Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Reading BIOS Information with C#

alexschunkalexschunk Member Posts: 4
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

  • alexschunkalexschunk Member Posts: 4
    Ok,

    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.
    :

  • huawei_1988huawei_1988 Member Posts: 4
    hi,

    // 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%28v=VS.85%29.aspx


    hope this code helps you.


    Thanks and Regards
    huawei_1988


  • huawei_1988huawei_1988 Member Posts: 4
    This post has been deleted.
Sign In or Register to comment.