Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create multiple yet unique desktop shortcuts?
Message
De
10/09/2002 13:33:41
 
 
À
10/09/2002 12:56:41
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00698572
Message ID:
00698904
Vues:
26
Okay, here is an example. You would use createLicenseFile() at your office. VerifyLicenseFile() would be called by the application everytime it loads. It would be much better if you encrypted this information.

I hope this gives you the general idea.
&& you do this
createlicenseFile("license.dat","Big City Medical Associates","130192",5)
&& the applicataion does this
llSuccess = readlicensefile("license.dat")
here are the functions:
procedure createLicenseFile
lparameters lcLicenseFileName, lcClinicName, lcClinicNum, lnUsers
	* data file format:
	* (1, 40)    Clinic Name
	* (41,10)    Clinic Number
	* (51, 5)    Number of users
	* (56, 6)    Checksum
	local lcOutString, ;
			lnChecksum

	lcOutString = padr(lcClinicName,40) + padr(lcClinicNum,10) + transform(lnUsers,"99999")
	
	lcOutString = lcOutString + transform(sys(2007, lcOutString),"999999")
	
	strtofile(lcOutString, lcLicenseFileName)
	
endproc



procedure verifyLicenseFile
lparameters lcLicenseFileName

	* data file format:
	* (1, 40)    Clinic Name
	* (41,10)    Clinic Number
	* (51, 5)    Number of users
	* (56, 6)    Checksum
	local lcInString, ;
			lnChecksum, ;
			lcClinicName, ;
			lcClinicNum, ;
			lnUsers
			
	lcInString = filetostr(lcLicenseFileName)

	lcChecksum = sys(2007, substr(lcInstring,1,55))

	if transform(lcChecksum,"999999") = substr(lcInstring, 56, 6)
		* you would probably put this information into your application object
		lcClinicName = substr(lcInstring, 1, 40)
		lcClinicNum  = substr(lcInstring, 41, 10)
		lnUsers      = int(val(substr(lcInstring,51,5)))
		? "successful validatation:"
		? lcClinicName, lcClinicNum, lnUsers
		return .t.
	else
		? "cheater, cheater, pumkin eater"
		return .f.
	endif

endproc
>>Ravi,
>>
>>I'll have a couple of example functions for you in a few minutes...
>
>Steve, thats awesome help. Thank you.
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform