How would it be possible to return the BIOS serial number or perheps better the motherboard serial number.
I have googled for hours but cant find an example of this that fits with VC++ 2008 Express Edition.
Any idéas will be helpful..
How would it be possible to return the BIOS serial number or perheps better the motherboard serial number.
I have googled for hours but cant find an example of this that fits with VC++ 2008 Express Edition.
Any idéas will be helpful..
Last edited by Coding; 05-16-2009 at 09:20 AM.
suggest make use of WMI script
Code:SELECT * FROM Win32_BIOS
Yes, I have found something like this. It is originally a C# code that I am trying to convert to C++ but I have problem to understand when it comes to foreach wich is a C# code that does´nt exist in C++.
Code:String^ s = "SELECT SerialNumber FROM WIN32_BaseBoard"; System::Management::ManagementObjectSearcher^ oWMI = gcnew System::Management::ManagementObjectSearcher(s); System::Management::ManagementObjectCollection^ oSerialNumbers = oWMI->Get(); //How can I convert this to C++ also //foreach (System.Management.ManagementObject mo in oSerialNumbers) //{ //Console.WriteLine("Serial Number: " + //mo.Properties["SerialNumber"].Value.ToString()); //}
Yes, thank you.. I thought about something like that also.
I did something like this. As I understand the oSerialNumbers contains objects but I dont know how I will convert them to Strings.
I am not really sure what I have to do inside that loop.
Code:for int i = 0; i < oSerialNumbers->Count; i++ ) { //? }
I am trying to do something like this but I know I dont pass the oSerialNumbers in any way:
I cant do like this:Code:for( int i = 0; i < oSerialNumbers->Count; i++ ) { System::Management::ManagementObject^ mo = gcnew System::Management::ManagementObject(); MessageBox::Show(mo->Properties["SerialNumber"]->Value->ToString()); }
Code:System::Management::ManagementObject^ mo = gcnew System::Management::ManagementObject(oSerialNumbers[i]);
Last edited by Coding; 05-16-2009 at 11:36 AM.