Discuss this help topic in SecureBlackbox Forum

Get the list of files in the ZIP archive

To get the list of files in the archive, the following steps should be performed:

  1. Open the archive;
  2. use Directory property to get the root directory of the ZIP archive;
  3. use Directory.Entries property to get entries of the directory;
  4. for all entries with IsDirectory property set to True use EntryWithPath method or EntryWithName method to change current ZIP archive directory and repeat step 3.

Example:
private void GetFiles(String entrypath, List<string> Files)
{
	String st;
	TElZipArchiveDirectoryEntry rootEntry, entry;
	int i;

	if (entrypath != "")
	{
        	rootEntry = ZipWriter.Directory.EntryWithPath(entrypath);
	}
	else
	{
		rootEntry = ZipWriter.Directory;
	}

	for (i = 0; i < rootEntry.EntriesCount; i++)
	{
		entry = rootEntry.get_Entries(i);
		Files.Add(entry.FileName);

		if (entry.IsDirectory)
		{
			GetFiles(entry.Path, Files);
		}
	}
}

How To articles about Zip file operations

Discuss this help topic in SecureBlackbox Forum