![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java JavaScript Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(AutoIt) Find a ZIP Entry by EntryID Using EntryByIdSee more Zip Examples This example demonstrates how to use the Each This is useful when:
The example:
Note: This example requires Chilkat v11.0.0 or greater.
Local $bSuccess = False $bSuccess = False ; Open an existing ZIP archive. $oZip = ObjCreate("Chilkat.Zip") $bSuccess = $oZip.OpenZip("example.zip") If ($bSuccess = False) Then ConsoleWrite($oZip.LastErrorText & @CRLF) Exit EndIf ; Retrieve the first entry in the ZIP archive. $oEntry = ObjCreate("Chilkat.ZipEntry") $bSuccess = $oZip.EntryAt(0,$oEntry) If ($bSuccess = False) Then ConsoleWrite($oZip.LastErrorText & @CRLF) Exit EndIf ConsoleWrite("Original entry:" & @CRLF) ConsoleWrite(" FileName: " & $oEntry.FileName & @CRLF) ConsoleWrite(" EntryID: " & $oEntry.EntryID & @CRLF) ConsoleWrite("" & @CRLF) ; Save the EntryID for later use. Local $iEntryId = $oEntry.EntryID ; Create another ZipEntry object. $oEntry2 = ObjCreate("Chilkat.ZipEntry") ; Retrieve the same entry using EntryById. $bSuccess = $oZip.EntryById($iEntryId,$oEntry2) If ($bSuccess = False) Then ConsoleWrite($oZip.LastErrorText & @CRLF) Exit EndIf ConsoleWrite("Entry retrieved by EntryID:" & @CRLF) ConsoleWrite(" FileName: " & $oEntry2.FileName & @CRLF) ConsoleWrite(" EntryID: " & $oEntry2.EntryID & @CRLF) ConsoleWrite("" & @CRLF) ; The filenames and EntryID values should match. $oZip.CloseZip ConsoleWrite("Done." & @CRLF) |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.