Quantcast
Channel: Windows XP Forum RSS Feed
Viewing all articles
Browse latest Browse all 25

Exception when reading BIOS information

$
0
0
Hello,

i got an Exception when i try to read some BIOS informaiton with WMI using C#.

I have the following code:

public static string GetBIOSBuildName()
{
string name = "";
try
{

ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * FROM Win32_bios");
ManagementObjectCollection qCollection = query.Get();
foreach (ManagementObject mo in qCollection)
{
if (name == null)
{
name = mo["BuildName"].ToString();
}
}
}
catch (Exception e)
{
return "error";
}
return name;
}

It looks like i cannot read the BuildNumber and some other information but i can read BuildVersion, Caption and Language.

Do i need some other code for reading BuildNumber etc?

Thank you.

Viewing all articles
Browse latest Browse all 25

Trending Articles