views:

95

answers:

6

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 cant be changed that I could put on a black list? and how would I access that in c#?

A: 

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 its not super easy to change

NickAtuShip
MAC addresses can generally be changed via a pretty UI for most cards. Generally in the driver settings.
Alun Harford
+1  A: 

See this question. It gives a couple of alternative approaches.

luvieere
+1  A: 

MAC address can actually be changed quite easily.

This article: has info on exactly waht you want: http://www.codeproject.com/KB/system/GetHardwareInformation.aspx

basically, just mix a few of the hardware component IDs, and you should have a pretty solid key for your system.

Erich
+2  A: 

A combination of CUPID,Hard disk Volumn 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 you format the disk).

Ted Lee
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
+1  A: 

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
A: 

I think going to use the MAC address. I goggled it and cant get any of the examples, such as (link) to work. For some reason "ManagementClass" is not in the namespace "System.Management". I am running visualStudio2008, is this code outdated or is there something wrong with my installation?

Lienau