Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

November 15, 2006

How to find a file in a Zip when the filename is known but not the path.

This VB6 zip component example demonstrates how to find a file within a Zip when the filename is known but not the path. The same methods apply when using the Chilkat Zip library in C#, VB.NET, FoxPro, Delphi, Ruby, Perl, Python, Java, ASP, ASP.NET, C++, etc.

    success = zip.OpenZip("test.zip")
    If (success = 0) Then
        MsgBox zip.LastErrorText
        Exit Sub
    End If
	
    ' We want to find the file "dudeC.gif"
    Dim zipEntry As ChilkatZipEntry2
	
    ' First, see if the exact match exists, without any directory path.
    Set zipEntry = zip.FirstMatchingEntry("dudeC.gif")
	
    ' Now look for any entry with a path.
    If (zipEntry Is Nothing) Then
        Set zipEntry = zip.FirstMatchingEntry("*/dudeC.gif")
    End If
	
    If (zipEntry Is Nothing) Then
        MsgBox "Not found!"
    Else
        MsgBox "Found!"
    End If


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.