Ways to get a Computers "ID"

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2008
Posts: 122
Reputation: Liszt is an unknown quantity at this point 
Solved Threads: 6
Liszt Liszt is offline Offline
Junior Poster

Re: Ways to get a Computers "ID"

 
1
  #11
May 16th, 2009
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

  1. 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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 122
Reputation: Liszt is an unknown quantity at this point 
Solved Threads: 6
Liszt Liszt is offline Offline
Junior Poster

Re: Ways to get a Computers "ID"

 
0
  #12
May 16th, 2009
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 ?

  1. ManagementObjectSearcher ^searcher;
  2. ManagementObjectCollection::ManagementObjectEnumerator ^queryEnum;
  3. ManagementBaseObject ^objMgmt;
  4.  
  5. searcher = gcnew ManagementObjectSearcher("SELECT * FROM Win32_Baseboard");
  6.  
  7. ManagementObjectCollection ^queryCollection = searcher->Get();
  8.  
  9. queryEnum = queryCollection->GetEnumerator();
  10.  
  11. while(queryEnum->MoveNext())
  12. {
  13. objMgmt = queryEnum->Current;
  14. MessageBox::Show(Convert::ToString(objMgmt->GetPropertyValue("SerialNumber")));
  15. }
Last edited by Liszt; May 16th, 2009 at 3:04 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,618
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1491
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Ways to get a Computers "ID"

 
0
  #13
May 16th, 2009
If you post the complete program (or some test code) then we can test it on our computers to see what it returns.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 122
Reputation: Liszt is an unknown quantity at this point 
Solved Threads: 6
Liszt Liszt is offline Offline
Junior Poster

Re: Ways to get a Computers "ID"

 
0
  #14
May 16th, 2009
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;
  1. ManagementObjectSearcher ^searcher;
  2. ManagementObjectCollection::ManagementObjectEnumerator ^queryEnum;
  3. ManagementBaseObject ^objMgmt;
  4.  
  5. searcher = gcnew ManagementObjectSearcher("SELECT * FROM Win32_Baseboard");
  6.  
  7. ManagementObjectCollection ^queryCollection = searcher->Get();
  8.  
  9. queryEnum = queryCollection->GetEnumerator();
  10.  
  11. while(queryEnum->MoveNext())
  12. {
  13. objMgmt = queryEnum->Current;
  14. MessageBox::Show(Convert::ToString(objMgmt->GetPropertyValue("SerialNumber")));
  15. }



Originally Posted by Ancient Dragon View Post
If you post the complete program (or some test code) then we can test it on our computers to see what it returns.
Last edited by Liszt; May 16th, 2009 at 3:44 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 977
Reputation: MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice 
Solved Threads: 92
MosaicFuneral's Avatar
MosaicFuneral MosaicFuneral is offline Offline
Posting Shark

Re: Ways to get a Computers "ID"

 
0
  #15
May 16th, 2009
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.
"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
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 122
Reputation: Liszt is an unknown quantity at this point 
Solved Threads: 6
Liszt Liszt is offline Offline
Junior Poster

Re: Ways to get a Computers "ID"

 
0
  #16
May 16th, 2009
This is true, I am checking for possibilities and in the end, I will be that careful to see what can be possible or it wont be, how to define things etc...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC