Uniquely identify PC based on software/hardware

后端 未结 7 1742
甜味超标
甜味超标 2020-12-16 19:38

For a requirement to generate per-PC license keys, I need some code which will return a stable and (near) unique key on any PC. It doesn\'t have to be guaranteed un

相关标签:
7条回答
  • 2020-12-16 20:20

    One idea I had a while back for this is to use CryptProtectData as a way to identify a machine. Behind-the-scenes in that API, Microsoft has done what you're looking for. I never tested it though and I'm curious if it's actually viable.

    Basically you would encode a constant magic value with CryptProtectData with CRYPTPROTECT_LOCAL_MACHINE, and the result is your machine ID.

    0 讨论(0)
提交回复
热议问题