OK so i was using MAC address as a unique identifier , all went good until i activated a VPN and the mac address changed.....
So, i have 2 options:
1) Get the MAC Address of the actual physical network card
For mac address i found several tips on how to achieve this:
2.) Get the motherboard ID and use that instead, and hope we dont get 2 computer with same id( is that possible? )
public String getMotherBoardID()
{
String serial = "";
try
{
ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT SerialNumber FROM Win32_BaseBoard");
ManagementObjectCollection moc = mos.Get();
foreach (ManagementObject mo in moc)
{
serial = mo["SerialNumber"].ToString();
}
return serial;
}
catch (Exception)
{
return serial;
}
}
What do you say? Should i try to dig and find code that gets the mac address from the card and not the virtual ones, or should i just switch to motherboard? And i don't need to combine anything, i just need something that is not going to change so easily on the targeted computer.
Its better if you could use a combination of values from Motherboard, NIC and harddrive.
You may check this article: How To Get Hardware Information (CPU ID, MainBoard Info, Hard Disk Serial, System Information , ...)
I think an approach similar to the following would be as secure as it can get
An example (i'm thinking C# from now on) of not being able to run unless it's licensed, would be to make some fundamental method extern
. You'll send the required assembly in response to a valid license, or fallback to a "Gotcha!" warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With