Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Key Generation
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00641547
Message ID:
00642057
Views:
10
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
Previous
Reply
Map
View

Click here to load this message in the networking platform