Retrieves the name of a file in a compressed archive.
Parameters
Parameter |
Description |
index |
File index inside the compressed archive. The index must be between 0 and GetItemsCount-1. |
Return Value
The name of the file.
Example
|
Copy code
|
var zip = new DlxFile("demo.zip", DlxApp.FILEOPEN_ZIP);
if (zip.IsValid())
{
zip.AddText("demo.txt", "Text file demo.");
zip.AddText("folder1/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] Path=%s, Name=%s, Title=%s, Ext=%s", i, unzip.GetItemLength(i), unzip.GetItemPath(i), unzip.GetItemName(i), unzip.GetItemTitle(i), unzip.GetItemExt(i));
}
unzip.Close();
}
|
See also