← Foro de Visual FoxPro

ENCRIPTAR ARCHIVOS DBF

Hilo en el foro de Visual FoxPro · 08 de Octubre del 2004 · 1 respuestas
JAVIER08 de Octubre del 2004
Pregunta
Amigos podrian ayudarme como puedo encripytar una tabla o archivo dbf

gracias por su ayuda

Respuestas 1

Carlos08 de Octubre del 2004
use TINDEX exclu
*Do EncDesData With "ON" && Encripta
Do EncDesData With "OFF" &&Desencripta


********************************************************************
Procedure EncDesData
LPARAMETERS LCENCR
maxno=100
LCENCR=UPPER(ALLT(LCENCR))
IF LCENCR<>'ON' AND LCENCR<>'OFF'
RETURN MESSAGEBOX("Pass ON or OFF for encryption/decryption!")
ENDIF
LNFIELDS=FCOUNT()
FOR J = 1 TO LNFIELDS
LCFIELD=FIELD(J)
* wait wind lcfield
* if lcfield="NOMDBF"
* loop
* endif
DO CASE
CASE TYPE(LCFIELD) $ 'CM'
REPL ALL &LCFIELD WITH CONVRT(LCENCR,&LCFIELD)
ENDCASE
ENDFOR


PROCEDURE CONVRT
lparameters lcencrypt,lcstring
if parameters()<2
messagebox('Pass two arguments, [On Off] and string')
return
endif
lcencrypt=upper(allt(lcencrypt))
if lcencrypt='ON'
lnlen=len(allt(lcstring))
lcnewstring=''
for i = 1 to lnlen
if i<maxno
lcchar=chr(asc(substr(lcstring,i,1))+i)
else
lcchar=chr(asc(substr(lcstring,i,1))+1)
endif
lcnewstring=lcnewstring+lcchar
endfor
RETVAL=LCNEWSTRING
ELSE
lnlen=len(allt(lcstring))
lcnewstring=''
for i = 1 to lnlen
if i<maxno
lcchar=chr(asc(substr(lcstring,i,1))-i)
else
lcchar=chr(asc(substr(lcstring,i,1))-1)
endif
lcnewstring=lcnewstring+lcchar
endfor
RETVAL=LCNEWSTRING
ENDIF
RETURN (RETVAL)
¿Buscas más hilos como este? Mira el foro de Visual FoxPro o usa el buscador.