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.
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.