Domanda

I am new in WPF. I have WPF application with MS SQL and I published it, set it to client's PC and want client use it only his own PC, can not copy that application (with database) and use it in other PC.

How can I prevent it?

I researched and knew to use Mac Address of PC. To crypt mac address and on app start to check crypted mac address is valid or not. But, on this case, user can change mac address of other PC and can use application there.

Which ways (methods) are there for solve my issue?

È stato utile?

Soluzione

Once i was doing research of best ways to generate unique keys for the computer base on hardware devices.

If not try to use composite keys, i.e. rely on some unique characteristic of the one device, then these keys are actually NOT EXISTS!!!

Research results (shortly)

The following devices were addressed to search for unique keys:

  • Motherboard
  • CPU
  • HDD
  • Network Card

Each device has two attributes: model and serial number

But here's what happens:

  • Often manufacturer for motherboard, for example, set the serial number with placeholders or as 123456.
  • CPU properties which could be considered as a unique - ProcessorID, repetitive too and generally at the end I got the impression that the for processors of the same type manufacturers put one number. i.e. we can assume there is no serial number at all for cpu, or it is impossible get programmatically
  • Situation with HDD is better. Serial number within the model and series differ.
  • Change MAC address of Network Card is easy enough

In general, a lot of people on the forums write that often faced with non-unique numbers of devices.

Thus, the only option of a unique key can be composite key collected from the characteristics of different devices and other computer properties.

As the unique characteristics of the system can also be considered the following: System UUID (Universal Unique ID) - this some unique key of system

And the formula of unique key is:

HASH(MotherBoard.Product + MotherBoard.SerialNumber + PhysicalDisk.ModelNumber + PhysicalDisk.SerialNumber + ComputerSystemProduct.UUID)

  • MotherBoard.Product - motherboard model name
  • MotherBoard.SerialNumber - motherboard serial number
  • PhysicalDisk.ModelNumber - physical disk model (NOT logical disk!!!)
  • PhysicalDisk.SerialNumber - physical disk serial number
  • ComputerSystemProduct.UUID - unique system number

All properties above can be obtained through WMI, but PhysicalDisk.SerialNumber not always here for unknown reasons. You can find some C++ solutions for read HDD serial number, but instead PhysicalDisk.SerialNumber we decided to take Signuture value of the disc object which returned via WMI.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top