I'm creating a program that authenticates from a before it runs. I also want to deny access. Is there an id or a serial that all Windows computers have that can't be changed, that I could put on a black list? And how would I access that in C#?
-
1Something to keep in mind is that people often swap hardware in and out of their systems. You wouldn't want your software to stop working simply because someone bought a new NIC or upgraded their video card. – Adam Batkin Oct 31 '09 at 18:51
-
See this question: http://stackoverflow.com/questions/99880/generating-a-unique-machine-id. It gives a couple of alternative approaches. – luvieere Oct 31 '09 at 18:48
4 Answers
MAC address can actually be changed quite easily.
This article: has info on exactly what you want: How To Get Hardware Information.
Basically, just mix a few of the hardware component IDs, and you should have a pretty solid key for your system.
A combination of CUPID, hard disk volume ID and MAC address would be a good choice. They won't be changed unless with hardware changes. (However, HD vol. ID would be changed if you format the disk)
-
In a previous job we fell back on the hard disk ID for licensing. We knew it wasn't ideal, but it was something. – ChrisF Oct 31 '09 at 19:04
This kind of restriction on access is generally accomplished by a hardware dongle or by a licensing server. Without these, specifically identifying a particular PC as the 'allowed machine' is a tricky proposition and anything you choose is likely to be spoofable.

- 28,584
- 8
- 61
- 87
Hmm, off the top of my head MAC address would be a good choice. It could be changed by getting a new NIC card, but it's not super easy to change.

- 26,356
- 27
- 122
- 180

- 939
- 6
- 18
-
2MAC addresses can generally be changed via a pretty UI for most cards. Generally in the driver settings. – Alun Harford Oct 31 '09 at 21:36