ID or a serial number that all Windows computer have and that can't be changed
I'm creating a program that authenticates from a before it runs. I also want to开发者_JAVA百科 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#?
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.
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.
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)
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.
精彩评论