Reading BIOS Information with C#

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

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

  • 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(v=VS.85).aspx


    hope this code helps you.


    Thanks and Regards
    huawei_1988


  • This post has been deleted.
Sign In or Register to comment.

Howdy, Stranger!

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

Categories