PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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
// 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)
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)
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.
    Windows Mobile The strings being in Unicode format, each letter of the identifier corresponds to 4 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 re-initialized by InitRandom.
Related Examples:
The Key functions Unit examples (WINDEV): The Key functions
[ + ] Using the functions for calculating the activation keys of WLanguage.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Minimum required version
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment