|
|
|
|
KeyGenerateInitialKey (Function) In french: CléGénèreCléInitiale Generates the initial key (unique license number) for the activation system of the application. This initial key must be transmitted to the application provider in order to get the activation key. // Your secret to customize Secret is string = "]$x+9*EBM%u]yK|R@=y" // ------------------------------------ // In the application, client side InitialKey is string InitialKey = KeyGenerateInitialKey(ClientID) Info("Your license key is: " + InitialKey)  // -> InitialKey is transmitted to the application provider  // -------------------------------------------- // Provider side: calculating the activation key ActivationKey is string Identifier is string  ActivationKey = KeyCalcActivationKey(InitialKey, Secret) Identifier = KeyGetIdentifier(InitialKey) Info("Activation key generated for the client " + Identifier + ": " + ActivationKey) // -> ActivationKey is transmitted to the client for the activation of his license  //-------------------------------------------- // Client side: Entering the activation key gbActivationOK = KeyCompareKey(InitialKey, ActivationKey, Secret) IF gbActivationOK = False THEN Error("Wrong activation key") EndProgram() END Syntax
<Result> = KeyGenerateInitialKey([<Identifier>])
<Result>: Character string Initial key generated by the application. The size of this key depends on the presence of <Identifier>: - if <Identifier> is not specified, the initial key will contain 20 characters.
- if <Identifier> is specified, the initial key will contain 20 characters plus 2 characters for each letter found in <Identifier>.
Example: The identifier contains 5 characters. The generated key will correspond to 20 + (2 * 5) = 30 characters.
<Identifier>: Optional character string Identifier used to generate a specific initial key containing user data for instance. This data can be retrieved by KeyGetIdentifier. Remarks - An identifier that was used to generate an initial key with WINDEV Mobile cannot be retrieved by WINDEV.
- The internal generator of random numbers is used to generate a key. This generator can be reinitialized with InitRandom.
Related Examples:
|
Unit examples (WINDEV): The Key functions
[ + ] Using the functions for calculating the activation keys of WLanguage.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|