(PureBasic) Open and Unzip an AES Encrypted Zip
Open and unzip an AES encrypted Zip.
IncludeFile "CkZip.pb"
Procedure ChilkatExample()
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
zip.i = CkZip::ckCreate()
If zip.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success.i = CkZip::ckOpenZip(zip,"/myZips/aes.zip")
If success <> 1
Debug CkZip::ckLastErrorText(zip)
CkZip::ckDispose(zip)
ProcedureReturn
EndIf
; Set the password needed to unzip.
; This password must match the password used when the zip
; was created.
CkZip::setCkDecryptPassword(zip, "myPassword")
unzipCount.i
; Unzip the .zip into /unzipDir.
; Returns the number of files and directories unzipped.
unzipCount = CkZip::ckUnzip(zip,"/unzipDir/")
If unzipCount < 0
Debug CkZip::ckLastErrorText(zip)
Else
Debug "Success!"
EndIf
CkZip::ckDispose(zip)
ProcedureReturn
EndProcedure
|