|
|
|
|
|
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.
Secret is string = "]$x+9*EBM%u]yK|R@=y"
CléInitiale is string
CléInitiale = KeyGenerateInitialKey(IDClient)
Info("Votre clé de licence est : " + CléInitiale)
CléActivation is string
Identifiant is string
CléActivation = KeyCalcActivationKey(CléInitiale, Secret)
Identifiant = KeyGetIdentifier(CléInitiale)
Info("Clé d'activation générée pour le client " + Identifiant + " : " + CléActivation)
gbActivationOK = KeyCompareKey(CléInitiale, CléActivation, Secret)
IF gbActivationOK = False THEN
Error("Mauvaise clé d'activation")
EndProgram()
END
Syntax
<Result> = KeyGenerateInitialKey([<Identifier>])
<Result>: Character string Initial key generated by the application. The key size varies depending on whether or not <Identifier> is specified: - 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 5-character identifier. 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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|