ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Activation key functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
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.
Example
// Votre secret ici à personnaliser
Secret is string = "]$x+9*EBM%u]yK|R@=y"
// ------------------------------------
// Dans l'application, côté client
CléInitiale is string 
CléInitiale = KeyGenerateInitialKey(IDClient)
Info("Votre clé de licence est : " + CléInitiale)

// -> CléInitiale est transmis au fournisseur de l'application

// --------------------------------------------
// Côté fournisseur : calcul de la clé d'activation
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)
// -> CléActivation est transmis au client pour activation de sa licence

//--------------------------------------------
// Côté client : Saisie de la clé d'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:
The Key functions Unit examples (WINDEV): The Key functions
[ + ] Using the functions for calculating the activation keys of WLanguage.
Component: wd300std.dll
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/25/2025

Send a report | Local help