1

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#?

Charles
  • 50,943
  • 13
  • 104
  • 142
Lienau
  • 1,353
  • 1
  • 20
  • 38
  • 1
    Something 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 Answers4

2

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.

bluish
  • 26,356
  • 27
  • 122
  • 180
Erich
  • 657
  • 5
  • 6
2

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)

bluish
  • 26,356
  • 27
  • 122
  • 180
Ted Lee
  • 63
  • 4
  • 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
2

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.

Jherico
  • 28,584
  • 8
  • 61
  • 87
-1

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.

bluish
  • 26,356
  • 27
  • 122
  • 180
ChickenMilkBomb
  • 939
  • 6
  • 18