Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Serial Number Options
Message
From
04/08/2003 09:05:57
 
 
To
02/08/2003 00:02:53
Michael Gass
Instructional Software, Inc.
Kirkland, Washington, United States
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00815455
Message ID:
00816460
Views:
24
Yes I still use the serialhash() method, which is identical to the gencode.prg except that the gencode.prg actually contains the registry variable rootkey, through defined variables.
If you know what your root key is, you can actually just create your own gencode application.

Here is an example of where I pulled the code out to create a serial number generator(separate application) for the owner of the software.
LOCAL lcBase
lcBase=thisform.txtmy1.getvalue()
DO case
	CASE EMPTY(lcBase)
		thisform.omessage.warning("enter a six digit serial number base first")
	CASE LEN(ALLTRIM(lcbase))!=6
		thisform.omessage.warning("serial number base must be six digits")
	OTHERWISE &&calculate it.
		lcBase=ALLTRIM(lcBase)
		**following is copied and modified from gencode.prg
*		#include 'ezwindefs.h' 

		**removed the #include and supplied it with the m.crootkey and m.cleft
		
		LOCAL cRootKey, cLeft, cRight, cSerialNo
		  * Build root system registry key, minus version number.
		  * Used to create unique serial numbers for each application.
		  m.cRootKey = 'Software\company\softwarename\'
	      m.cLeft = lcBase &&LEFT(m.cLeft, 6)
	      m.cRight = m.cRootKey + STRTRAN(STRTRAN(m.cLeft, ' ', ''), '-', '')
	      m.cSerialNo = m.cLeft + '-' + PADL(SYS(2007, UPPER(m.cRight) + LOWER(m.cRight)), 5, '0')
	      
	      thisform.txtmy2.setvalue(PROPER(m.cSerialNo)) 
	      _cliptext=(PROPER(m.cSerialNo))
endcase
Previous
Reply
Map
View

Click here to load this message in the networking platform