Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to bury a file...
Message
 
To
23/08/2006 13:15:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01147925
Message ID:
01147983
Views:
17
In addition to Jos Frank an Nigel -
You could use your encrpted dates in the system file - have the "first run" time stamp tied to a SYS(2015) and a serial number.

You might want to ad a registry entry. That way, should the use uninstall and the reinstall - to chaeat on the evaluation period - when the program first starts it checks for a particular reistry key and value - if it's there - and the install thinks it's a "first run" (virgin) then there has been an evaluation violation.

Here are some tricks you could consider:
PROCEDURE R6_EncryptDate(ldDate)
* Creates a 4 character string representation of the date
lcDate=STRTRAN(DTOC(ldDate),[/],[])
c1=CHR(VAL(SUBSTR(lcDate,1,2)))
c2=CHR(VAL(SUBSTR(lcDate,3,2)))
c3=CHR(VAL(SUBSTR(lcDate,5,2)))
c4=CHR(VAL(SUBSTR(lcDate,7,2)))
RETURN c1+c2+c3+c4
ENDPROC 

PROCEDURE R6_DecryptDate(lcDate)
* Convets string encripted date to date type
s1=TRANSFORM(ASC(SUBSTR(lcDate,1,1)))
s2=TRANSFORM(ASC(SUBSTR(lcDate,2,1)))
s3=TRANSFORM(ASC(SUBSTR(lcDate,3,1)))
s4=RIGHT(STR(ASC(SUBSTR(lcDate,4,1))+100,3),2)
RETURN CTOD(s1+[/]+s2+[/]+s3+s4)
ENDPROC 

PROCEDURE R6_UNCreateSerialID(cSerial)
cSYS2015=[]
FOR c=1 TO 9
cSYS2015=cSYS2015+CHR(VAL(SUBSTR(cSerial,(c*2)-1,2))+(13-c))
ENDFOR 
RETURN cSYS2015

* Turn a SYS(2015) key into a 18 digit serial number.
PROCEDURE R6_CreateSerialID(cKey) && cKey is the SYS(2015)
cSerialize=STRTRAN(cKey,[_],[])
cSerialNumber=[]
FOR c=1 TO 9
cSerialNumber=cSerialNumber+RIGHT(STR(ASC(SUBSTR(cSerialize,c,1))+100-(13-c),3),2)
ENDFOR
RETURN cSerialNumber
>Well sort of. The file is encrypted, I just want a place to put it.
>The purpose here is for a timestamp in a demo version.
>The contents is an encrypted Julian date. I've seen the market stuff
>and I'd rather do my own. So I want to park an encrypted file somewhere
>where if the user uninstalls the app, the file survives. What I've come up
>with is in order of attempts:
>
>1. "c:\windows\system32\msedms.txt"
>2. "c:\winnt\system32\msedms.txt"
>3. "c:\msedms.txt"
>4. "c:\temp\msedms.txt"
>
>All assume admin rights during install and setup. The file is created
>during setup, not install so it survives removal. The 'ms' prefix makes it
>look like an MS file (I recall my Charlemagne).
>
>I won't get into the details of my user demographic, market etc., but I believe
>this is sufficient for my purposes.
>
>Comments?
>
>Luke
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform