Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DynaZip zip file protection
Message
De
10/04/2003 11:52:29
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00775513
Message ID:
00776145
Vues:
10
Hi Mark,

Thanks for your reply and code sample. I did already implement this as I also could not find anyway to see if a password was in effect or not. I am therefore doing the same and attempting to extract a single small file without a password first. If it extracts correctly then I am rejecting the zip file.

Thanks anyway!


>>Hi Mark. I am using V4 and the dll's. I did not see any compelling reason to go to 5 for my purposes.
>
>Same here. Right off, I do not see anyway to determine this unless you try to extract a single file without setting a password. If that is false, try your password. The following code should work, just change "your_pwd" and "your_path" in the code.
>o = NEWOBJECT('DynaZip', 'DynaZip.fxp')
>o.lUNZ_NoMsgs = .t.
>o.cUNZ_ZipFile = GETFILE('zip')
>o.GetAllZipFileInfo()
>if not empty(o.aZI_FileInfo(1))
>   o.cUNZ_FileSpec = o.aZI_FileInfo(1)
>endif
>o.cUNZ_Destination = GETENV('temp')
>if o.UNZExtract()
>   *!* password not required. abort.
>   erase ADDBS(GETENV('temp')) + o.aZI_fileinfo(1)
>   return .f.
>endif
>o.cUNZ_CryptCode = 'your_pwd'
>o.lUNZ_CryptFlag = .t.
>if not o.UNZExtract()
>   *!* file encrypted with password other than yours. abort.
>   return .f.
>endif
>erase ADDBS(GETENV('temp')) + o.aZI_FileInfo(1)
>o.cUNZ_Destination = 'your_path'
>o.cUNZ_FileSpec = '*.*'
>o.UNZExtract()
>o.Release()
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform