Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Key Generation
Message
De
08/04/2002 03:43:34
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00641547
Message ID:
00642057
Vues:
11
Ronald,
The following is a similar approach to what Alex suggested. It generates a GUID but uses an API rather than the WSH. This is extremely fast. When I tested the function, it generated 80,000 GUIDs in about 2 seconds on my notebook.

o = NEWOBJECT("Win32api", "Win32Api.prg")
?o.getGUID()
DEFINE CLASS Win32Api AS Line
   
   ************************************************
   PROCEDURE Init
   ************************************************
      DECLARE INTEGER CoCreateGuid IN ole32 STRING @
   ENDPROC
   *-- EOF Init -----------------------------------------------------------------------
   
   ************************************************
   *-- Thanks to Markus Winhard
   FUNCTION GetGUID
   ************************************************

      LOCAL lcGuid
      lcGuid = SPACE(16)
      =CoCreateGuid(@lcGuid)
      RETURN lcGuid
     
   *-- EOF GetGUID --------------------------------------------------------------------

ENDDEFINE
>I am looking for a way to generate a product key.
>
>I will be using a 30 digit number that is unique to an application and I need to generate a 10 to 20 digit key for it.
>
>What would be the best way to do this?
>
>TIA Ron
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform