| | |
Ways to get a Computers "ID"
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 122
Reputation:
Solved Threads: 6
I have found a link:
http://www.codeguru.com/forum/showthread.php?t=249788
I think I will go for checking the BIOS SerialNumber. In the link it seems to fail when doing this on Windows 98 or earlier but if a fail meens an emty string like: "" that will work for my purpose.
They refer to get the BIOS Serial like below but when gooling on that, I am not sure if I can find anything helpful of how to return this serial number.
I use VC++ 2008 Express Edition
http://www.codeguru.com/forum/showthread.php?t=249788
I think I will go for checking the BIOS SerialNumber. In the link it seems to fail when doing this on Windows 98 or earlier but if a fail meens an emty string like: "" that will work for my purpose.
They refer to get the BIOS Serial like below but when gooling on that, I am not sure if I can find anything helpful of how to return this serial number.
I use VC++ 2008 Express Edition
C++ Syntax (Toggle Plain Text)
GetBIOSSerial(); //Is this a call, I cant find out if any namespace goes with this
Last edited by Liszt; May 16th, 2009 at 11:12 am.
•
•
Join Date: Oct 2008
Posts: 122
Reputation:
Solved Threads: 6
I have come up with a code that look like this that is supposed to return the motherboard serialnumber.
The number that is returned is: "123456789000"
I wonder if that really could be correct or perheps do I miss something in the code. I am looking for a unique serial number ?
The number that is returned is: "123456789000"
I wonder if that really could be correct or perheps do I miss something in the code. I am looking for a unique serial number ?
C++ Syntax (Toggle Plain Text)
ManagementObjectSearcher ^searcher; ManagementObjectCollection::ManagementObjectEnumerator ^queryEnum; ManagementBaseObject ^objMgmt; searcher = gcnew ManagementObjectSearcher("SELECT * FROM Win32_Baseboard"); ManagementObjectCollection ^queryCollection = searcher->Get(); queryEnum = queryCollection->GetEnumerator(); while(queryEnum->MoveNext()) { objMgmt = queryEnum->Current; MessageBox::Show(Convert::ToString(objMgmt->GetPropertyValue("SerialNumber"))); }
Last edited by Liszt; May 16th, 2009 at 3:04 pm.
•
•
Join Date: Oct 2008
Posts: 122
Reputation:
Solved Threads: 6
Yes, that would be more than nice.
I think this would be the complete testcode if I dont miss anything out.
I think this would be the complete testcode and see what this MessageBox returns.
You would have to add the reference System::Management in "Add New Reference"
using namespace System::Management;
I think this would be the complete testcode if I dont miss anything out.
I think this would be the complete testcode and see what this MessageBox returns.
You would have to add the reference System::Management in "Add New Reference"
using namespace System::Management;
C++ Syntax (Toggle Plain Text)
ManagementObjectSearcher ^searcher; ManagementObjectCollection::ManagementObjectEnumerator ^queryEnum; ManagementBaseObject ^objMgmt; searcher = gcnew ManagementObjectSearcher("SELECT * FROM Win32_Baseboard"); ManagementObjectCollection ^queryCollection = searcher->Get(); queryEnum = queryCollection->GetEnumerator(); while(queryEnum->MoveNext()) { objMgmt = queryEnum->Current; MessageBox::Show(Convert::ToString(objMgmt->GetPropertyValue("SerialNumber"))); }
Last edited by Liszt; May 16th, 2009 at 3:44 pm.
The part I replace most often: is the motherboard(usually in conjunction with PSU). Those thing short out all the time, and now I have piles of them!
So be wary about how you use that. The only reason I can find, to use it is to block suspected bots off something like a MMORPG for a few hours, till the lag drops.
So be wary about how you use that. The only reason I can find, to use it is to block suspected bots off something like a MMORPG for a few hours, till the lag drops.
"Jedenfalls bin ich überzeugt, daß der Alte nicht würfelt."
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
![]() |
Similar Threads
- Cannot Ping other computers in "edgeless network" configuration (Networking Hardware Configuration)
- google "keyword" question (Search Engine Optimization)
- Removal of "Home Search Assistant", "Search Extender", & "Shopping Wizard" (Viruses, Spyware and other Nasties)
- Wireless "B" networks not working anymore (Networking Hardware Configuration)
- I am unable to open the "Help" function in IE 6 Print Preview! (Web Browsers)
Other Threads in the C++ Forum
- Previous Thread: do CopyFile() DeletFile() function throw exception?
- Next Thread: Please Correct me
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






