10 Replies - 1226 Views - Last Post: 29 August 2011 - 10:26 AM Rate Topic: -----

#1 Programmer_С++  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 30
  • Joined: 08-August 11

Computer id

Posted 29 August 2011 - 07:37 AM

I need to develop a program for windows (using c++).
The program must identify a computer (by S/N of hard disk or any other divices), and then output this information.

My question has two parts:
- what information accessible for the programm can definitely identify a computer?
- how my program can read this information?

Thank you

This post has been edited by Programmer_С++: 29 August 2011 - 07:37 AM

Is This A Good Question/Topic? 0
  • +

Replies To: Computer id

#2 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1341
  • View blog
  • Posts: 3,513
  • Joined: 03-May 10

Re: Computer id

Posted 29 August 2011 - 07:48 AM

I'd say the machine's MAC address is probably the best way to tell computers apart programatically.
Was This Post Helpful? 0
  • +
  • -

#3 Programmer_С++  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 30
  • Joined: 08-August 11

Re: Computer id

Posted 29 August 2011 - 07:54 AM

View PostKilorn, on 29 August 2011 - 07:48 AM, said:

I'd say the machine's MAC address is probably the best way to tell computers apart programatically.


And if to imagine that a computer has not a netcard...

Ok, every computer has a hard disk which has a S/N.
How my program can read this S/N?
Was This Post Helpful? 0
  • +
  • -

#4 Coding in the name of  Icon User is offline

  • D.I.C Head

Reputation: 65
  • View blog
  • Posts: 227
  • Joined: 07-July 10

Re: Computer id

Posted 29 August 2011 - 07:56 AM

I did an MSDN search which brought up some discussions. I suggest you click through a few of them for some more information (http://social.msdn.m...ery=mac+address). The top one in particular is interesting (http://social.msdn.m...8c-461927f083c0) especially this part:

Quote

...However, conceptually using a MAC to uniquely identify a PC is a bad idea -- as PCs may have more than one MAC, and the MAC(s) that they have may change over time.

Simply creating a GUID and storing it in the registry would be a better way to uniquely identify the PC (assuming you are not concerned about users who may manually modify the registry).


That thread also linked to this page which shows how you can get the MAC address of a network adapter: http://weseetips.com...etwork-adapter/.
Was This Post Helpful? 0
  • +
  • -

#5 jimblumberg  Icon User is online

  • member icon

Reputation: 3112
  • View blog
  • Posts: 9,490
  • Joined: 25-December 09

Re: Computer id

Posted 29 August 2011 - 07:57 AM

Quote

Ok, every computer has a hard disk which has a S/N.


Actually not every computer has a hard disk.

Jim
Was This Post Helpful? 0
  • +
  • -

#6 Programmer_С++  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 30
  • Joined: 08-August 11

Re: Computer id

Posted 29 August 2011 - 08:07 AM

View Postjimblumberg, on 29 August 2011 - 07:57 AM, said:

Quote

Ok, every computer has a hard disk which has a S/N.


Actually not every computer has a hard disk.

Jim


A little correction: "Ok, almost every computer has a hard disk which has a S/N."

View PostCoding in the name of, on 29 August 2011 - 07:56 AM, said:

Quote

Simply creating a GUID and storing it in the registry would be a better way to uniquely identify the PC (assuming you are not concerned about users who may manually modify the registry).


I think that GUID is not optimal way to uniquely identify a PC, because if you reinstall OS and then install the program again, GUID will another... That is why I want to identify a computer by divices S/N.

This post has been edited by Programmer_С++: 29 August 2011 - 08:08 AM

Was This Post Helpful? 0
  • +
  • -

#7 DustyD  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 72
  • Joined: 19-August 09

Re: Computer id

Posted 29 August 2011 - 08:31 AM

If you are looking to identify a computer by it's hardware, if you are using BSD or Linux, there are command line programs that can print that information. You can also run those programs from inside a C/C++ program.. The command 'lspci' displays information about the chipsets and external hardware you have connected for instance
Was This Post Helpful? 1
  • +
  • -

#8 Programmer_С++  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 30
  • Joined: 08-August 11

Re: Computer id

Posted 29 August 2011 - 08:41 AM

View PostDustyD, on 29 August 2011 - 08:31 AM, said:

If you are looking to identify a computer by it's hardware, if you are using BSD or Linux, there are command line programs that can print that information. You can also run those programs from inside a C/C++ program.. The command 'lspci' displays information about the chipsets and external hardware you have connected for instance


Thank you, but my program must work only on windows
Was This Post Helpful? 0
  • +
  • -

#9 DustyD  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 72
  • Joined: 19-August 09

Re: Computer id

Posted 29 August 2011 - 08:50 AM

Doesn't the registry have that sort of information? I wouldn't know how to access it though
Was This Post Helpful? -1
  • +
  • -

#10 jimblumberg  Icon User is online

  • member icon

Reputation: 3112
  • View blog
  • Posts: 9,490
  • Joined: 25-December 09

Re: Computer id

Posted 29 August 2011 - 08:56 AM

See this link from MSDN Win32 Physical Media Class.

Quote

I think that GUID is not optimal way to uniquely identify a PC, because if you reinstall OS and then install the program again, GUID will another... That is why I want to identify a computer by divices S/N.


What happens when the hard drive is changed?

Jim
Was This Post Helpful? 2
  • +
  • -

#11 Salem_c  Icon User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 1418
  • View blog
  • Posts: 2,681
  • Joined: 30-May 10

Re: Computer id

Posted 29 August 2011 - 10:26 AM

How much hardware can I change before you decide it is a new machine?
It's the same problem Microsoft face when generating a fingerprint specific to a particular machine (to stop you using the same OS key over and over), but allowing a certain amount of "upgrade" capability.

- what information accessible for the programm can definitely identify a computer?
I guess any/all/some of these would help you characterise the machine
- processor (say through CPUID)
- BIOS make/version
- Amount of memory installed
- Disk serial number(s), capacity, partitions (perhaps)
- Enumerate the PCI bus (like lspci, but using windows APIs to do the same thing), say network and graphics devices.
- MAC addresses.
- Lots more ideas

- how my program can read this information?
Mostly, it's laborious digging through MSDN to find the right API to get at the information you want.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1