Sample code for 30+ languages & platforms
Xojo Plugin

Verify a Zip's Password

See more Zip Examples

Demonstrates how to verify the password for an encrypted or password-protected zip archive.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

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

Dim zip As New Chilkat.Zip

// To verify a password for a Zip, the Zip must be opened:
success = zip.OpenZip("myProtected.zip")
If (success <> True) Then
    System.DebugLog(zip.LastErrorText)
    Return
End If

// Set the password to be verified:
zip.DecryptPassword = "secret"

Dim passwordOk As Boolean
passwordOk = zip.VerifyPassword()
If (passwordOk = True) Then
    System.DebugLog("Password is correct.")
Else
    System.DebugLog("Password is incorrect.")
End If

zip.CloseZip