Sample code for 30+ languages & platforms
C#

List Files in a .zip

See more Zip Examples

How to list files within a .zip

Chilkat C# Downloads

C#
bool success = false;

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

Chilkat.Zip zip = new Chilkat.Zip();

success = zip.OpenZip("a.zip");
if (success == false) {
    Debug.WriteLine(zip.LastErrorText);
    return;
}

// Get the number of files and directories in the .zip
int n = zip.NumEntries;

Chilkat.ZipEntry entry = new Chilkat.ZipEntry();

int i = 0;

while (i < n) {
    zip.EntryAt(i,entry);
    if (entry.IsDirectory == false) {
        // (the filename may include a path)
        Debug.WriteLine(entry.FileName);
    }

    i = i + 1;
}