Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to control end user licences
Message
 
 
To
30/08/2000 11:08:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00410778
Message ID:
00410829
Views:
17
To get a unique Computer ID, see:

http://www.levelextreme.com/wconnect/wc.dll?UniversalThread~?2,15,271854

If you remove the NT path from the DECLARE statement, this will also work under Win98SE. I don't know about prior versions of Win9x. I then use the unique ID for the computer to lock in the use of the application to that computer only. I store the ID in a AppRegistry table along with another code based on some variation of the system date and time, take the check sum of both values [the unique id and system date and time] and store the check sum in a 3rd field.

So I have 3 fields in the AppRegistry table -- ComputerID [Character], LockCode [Character], ChkSum [Integer]. When I launch the app, I compare the CheckSum value in the ChkSum field to the CheckSum returned by the current data in the first 2 fields. If the values match, then I know the data has not been tampered with. If they do not match, I give the user a message that the application is no installed or activated properly and QUIT the app.

See VFP Help for Sys[2007] for getting the checksum of a value. My sample code for generating the ChkSum for all the fields EXCEPT the ChkSum field is:
local lnChkSum, i, lcFName, lcData, lcVal
lnChkSum = 0
for i = 1 to fcount()
	lcFName = field(i)
	if lcFName = "CHKSUM"
		loop
	endif
	lcData = transform(eval(lcFName), "@T")
	lcVal = Sys[2007, lcData]
	lnChkSum = lnChkSum + val(lcVal)
endfor
return lnChkSum
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform