我用Python制作了一个离线程序,现在我想把这个程序卖给客户,但是我想找到一种方法来防止客户在多台计算机上使用这个程序,我知道我可以通过使用Mac地址或硬件部件号来实现这个目的,但是客户不可能给我这个数据--我怎么做?
发布于 2021-12-05 00:32:28
您可以使用mac address
(在每种情况下都不同)来指定每个设备。比如,
from uuid import getnode as get_mac
import os
def welcome():
print('welcome user!')
purchased = false; # this will be declared true after payment.
if ((not os.path.exists('devId')) and purchased):
# activation after payment
open('devId', 'wt').write(str(get_mac()));
welcome();
elif (open('devId', 'rt').read() == get_mac()):
print('Purchase before using!')
exit()
else:
welcome();
https://stackoverflow.com/questions/70232477
复制相似问题