ManagementClass
class located in the System.Management
assembly. We have to add a reference to that assembly to our project, and import it into SecurityManager.vb, which will be the class in which we place the GetSerial()
and CheckKey()
functions. These two functions will be responsible for generating the serial number from the MAC address and checking whether the key entered by the user is valid. As a first step, we define the GetSerial()
function as follows:KeyGenerator
. This class will contain a function which will apply a simple mathematical function on the serial number to get the activation key. In this case, I will use the function f(x) = x2 + 53/x + 113 * (x/4).CheckKey()
. This function will take the activation key as a parameter, apply the key-generating function on the current MAC address, then compare the two keys to see whether they match or not.