Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynazip
Message
De
15/12/2003 14:12:09
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
 
 
À
15/12/2003 13:07:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Titre:
Divers
Thread ID:
00858794
Message ID:
00859224
Vues:
17
Thanks for the response. If I have 12 files to zip and 6 of them need to be protected with a password, is there a way to do that?

Jim

>>Thanks for the answers. Would I just set the EncryptFlag to true and the EncryptCode to the password that I want and then zip the files? Do you have/know of any sample code I could follow?
>
>Something like this:
>
>Local lcFileList, lcItemList, lcZipFileComment, llError, lcZIPFileName
>Local loZip As dzactxctrl.dzactxctrl.1
>lcFileList = ""
>lcZIPFileName = "BackData.Zip"
>
>* instantiate a DynaZip object to zip files
>Try
>  loZip = Createobject("dzactxctrl.dzactxctrl.1")
>  llError = .F.
>
>Catch To oErr
>  * could not instantiate DynaZIP library
>  * most probable Errno: 1733 - "Class definition <name> is not found"
>  loZip = .Null.
>  llError = .T.
>  * do whatever
>Endtry
>
>If llError
>  Return .F.
>Endif
>
>lcFileList = This.cDataFolder + "Delta*.DBF"
>lcFileList = lcFileList + " " + This.cDataFolder + "Merter*.XML"
>
>* use DynaZip ActiveX
>With loZip
>  .ActionDZ = ZIP_NOACTION    && turn off
>  .ZipFile = Alltrim(This.cFolder + lcZIPFileName)
>  .EncryptCode = "testpwd"
>  .EncryptFlag = .T.
>
>  * file(s) or list of items to ZIP (make sure it has full path)
>  .ItemList = Alltrim(lcFileList)
>
>  .NoDirectoryNamesFlag = .T.    && don't add path to ZIP files
>  .ActionDZ = ZIP_ADD        && executes
>  .ActionDZ = ZIP_NOACTION    && turn off
>
>  If .ErrorCode = ZE_OK
>    * all's well.
>  Else
>    * error creating ZIP file
>    lcMessage = "Error creating ZIP file!"
>    * I log error here and send email to SysAdmin
>    Messagebox(lcMessage, MB_ICONSTOP, "ZIP Error")
>  Endif
>Endwith
>
Thanks

Jim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform