Retrieve the number of files in a compressed archive.

syntaxSyntax:
DlxFile.GetItemsCount()

Return Value

Returns the number of files in a compressed archive or zero if an error occurs.

Example

  Copy codeCopy code
var zip = new DlxFile("demo.zip", DlxApp.FILEOPEN_ZIP);
if (zip.IsValid())
{
  zip.AddText("demo.txt", "Text file demo.");
  zip.AddText("demo1.txt", "Text file demo 1.");
  zip.Close();
};
var unzip = new DlxFile("demo.zip", DlxApp.FILEOPEN_UNZIP);
if (unzip.IsValid())
{
  DlxApp.Printf("%i", unzip.GetItemsCount());
  for (var i = 0; i < unzip.GetItemsCount(); i++)
  {
    DlxApp.Printf("%i: [%i] %s", i, unzip.GetItemLength(i), unzip.GetItemName(i));
  }
  unzip.Close();
}

See also