Sample code for 30+ languages & platforms
Visual FoxPro

Open and Unzip an AES Encrypted Zip

See more Zip Examples

Open and unzip an AES encrypted Zip.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loZip
LOCAL lnUnzipCount

lnSuccess = 0

* This example requires the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.

loZip = CreateObject('Chilkat.Zip')

lnSuccess = loZip.OpenZip("/myZips/aes.zip")
IF (lnSuccess <> 1) THEN
    ? loZip.LastErrorText
    RELEASE loZip
    CANCEL
ENDIF

* Set the password needed to unzip.
* This password must match the password used when the zip
* was created.
loZip.DecryptPassword = "myPassword"

* Unzip the .zip into /unzipDir.   
* Returns the number of files and directories unzipped.
lnUnzipCount = loZip.Unzip("/unzipDir/")
IF (lnUnzipCount < 0) THEN
    ? loZip.LastErrorText
ELSE
    ? "Success!"
ENDIF

RELEASE loZip