To get a unique Computer ID, see:
http://www.levelextreme.com/wconnect/wc.dll?UniversalThread~?2,15,271854If 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