0

I don't know if it is possible. I am developing a desktop app and I want to find a way to generate a permanent ID per a Windows computer in C#.

"Permanent" means this ID won't be changed between re-installations on the user computer.

I thought to use MAC address, but it can be different between two installations, for example if first time a user connected to WiFi and the second time via Ethernet cable.

Rougher
  • 834
  • 5
  • 19
  • 46
  • 1
    Generate a Guid and persist it on the computer somewhere (the registry or the file system) . Check that it's there the first time you run. If it isn't generate it. Don't erase it when you Uninstaller the application. – Flydog57 May 18 '23 at 15:01
  • You might want to define what a users computer is. When i change the mainboard but keep the same ssd with the same OS installation is that a different or the same Computer? If i reinstall windows but keep the hardware is that a different or the same Computer? What is your definition. – Ralf May 18 '23 at 15:15
  • I do not who closed my question, but it will be good for him to understand the difference between "unique" and "permanent". So my question is not answered! – Rougher May 19 '23 at 05:16
  • @Ralf Let's say mainboard is a computer for me. I don't think users change it every time. So, I can take mainboard ID? Does it exist on all mainboard? – Rougher May 19 '23 at 05:19
  • IDM also has the same logic but it relies on the OS for this info, if the OS is re installed then the ID changes and IDM thinks that this is a different computer. – Son of Man May 19 '23 at 06:26
  • Just use the OS, people rarely change their OS to avoid some kind of subscription which is the reason behind you wanting a unique machine ID. I have lots of important software and files on my OS and would never consider changing the OS to avoid some kind of subscription. – Son of Man May 19 '23 at 06:31
  • Your software has a trial which you want to disable by uploading the machine ID to the server and logging the installation time so you can compute if the trial days are over and then require a license – Son of Man May 19 '23 at 06:34
  • @DongLi In the case a user upgrades OS, let's say from Windows 10 to Windows 11 it will be ok still? Do you have a code for this solution? Thanks – Rougher May 19 '23 at 10:24
  • Please vote for reopening – Rougher May 19 '23 at 10:25
  • @Rougher, if it's OS upgrade while keeping current files, settings and apps then the ID should remain the same but if it's a complete change over then the ID should be new for the newer OS. – Son of Man May 19 '23 at 18:28
  • You can also read the motherboard serial number and the cpu serial number and use them to compute the unique machine ID and upload to server – Son of Man May 19 '23 at 18:28

0 Answers0