Restrict functionality to a certain computer

蓝咒 提交于 2019-12-06 05:19:05

问题


I have a program that is using a configuration file.

I would like to tie the configuration file to the PC, so copying the file on another PC with the same configuration won't work.

I know that Windows Activation Mecanism is monitoring hardware to detect changes and that it can tolerates some minor changes to the hardware.

Is there any library that can help me doing that?

My other option is to use WMI to get Hardware configuration and to program my own tolerance mecanism.

Thanks a lot,

Nicolas


回答1:


Microsoft Software Licensing and Protection Services has functionality to bind a license to hardware. It might be worth looking into. Here's a blog posting that might be of interest to you as well.




回答2:


If you wish to restrict the use of data to a particular PC you'll have to implement this yourself, or find a third-party solution that can do this. There are no general Windows API's that offer this functionality.




回答3:


You'll need to define what you currently call a "machine."

If I replace the CPU, memory, and hard drive, is it still the same computer? Network adaptor, video card?

What defines a machine?

There are many, many licensing libraries out there to do this for you, but almost all are for pay (because, ostensibly, you'd only ever want to protect commercial software this way). Check out what RSA, Verisign, and even microsoft have to offer. The windows API does not expose this, ostensibly to prevent hacking.

Alternately, do it yourself. It's not hard to do, the difficult part is defining what you believe a machine to be.

If you decide to track 5 things (HD, Network card, Video card, motherboard, memory sticks) and you allow 3 changes before requiring a new license, then users can duplicate the hard drive, take out two of the above, put them in a new machine, replace them with new parts in the old machine and run your program on the two separate PCs.

So it does require some thought.

-Adam




回答4:


If the machine has a network card you could always check its mac address. This is supposed to be unique and checking it as part of the program's startup routine should guarantee that it only works in one machine at a time... even if you remove the network card and put it another machine it will then only work in that machine. This will prevent network card upgrades though.




回答5:


Maybe you could just keep something in the registry? Like the last modification timestamp for this file - if there's no entry in the registry or the timestamps do not match then fall back to defaults - would that work? (there's more then one way to skin a cat ;) )



来源:https://stackoverflow.com/questions/682859/restrict-functionality-to-a-certain-computer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!