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
KeyCalcActivationKey (Function)
In french: CléCalculeCléActivation
Calculates the activation key of application from the initial key. The initial key was generated by KeyGenerateInitialKey. This activation key is unique.
Remark: As a general rule, this function is used on the application supplier's workstation: the customer provides the initial key, and the supplier calculates and sends the corresponding 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> = KeyCalcActivationKey(<Initial key> [, <Secret>])
<Result>: Character string
Unique activation key corresponding to the initial key.
<Initial key>: Character string
Initial key supplied by the client of the application. This key was generated by KeyGenerateInitialKey.
<Secret>: Character string or Secret string
Encryption key used to generate the activation key.
We advise you to fill this parameter so that only the application provider can generate a valid key for the application. The same value must be passed to KeyCompareKey

New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
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: 05/16/2025

Send a report | Local help