EntriesSorted Property

DotNetZip

Ionic Zip Library v1.9.1.6 EntriesSorted Property
ReferenceIonic.ZipZipFileEntriesSorted
Returns a readonly collection of entries in the Zip archive, sorted by FileName.
Declaration Syntax
C# Visual Basic Visual C++
public ICollection<ZipEntry> EntriesSorted { get; }
Public ReadOnly Property EntriesSorted As ICollection(Of ZipEntry)
	Get
public:
property ICollection<ZipEntry^>^ EntriesSorted {
	ICollection<ZipEntry^>^ get ();
}
Remarks
If there are no entries in the current ZipFile, the value returned is a non-null zero-element collection. If there are entries in the zip file, the elements are returned sorted by the name of the entry.
Examples
This example fills a Windows Forms ListView with the entries in a zip file.
CopyC#
using (ZipFile zip = ZipFile.Read(zipFile))
{
    foreach (ZipEntry entry in zip.EntriesSorted)
    {
        ListViewItem item = new ListViewItem(n.ToString());
        n++;
        string[] subitems = new string[] {
            entry.FileName.Replace("/","\\"),
            entry.LastModified.ToString("yyyy-MM-dd HH:mm:ss"),
            entry.UncompressedSize.ToString(),
            String.Format("{0,5:F0}%", entry.CompressionRatio),
            entry.CompressedSize.ToString(),
            (entry.UsesEncryption) ? "Y" : "N",
            String.Format("{0:X8}", entry.Crc)};

        foreach (String s in subitems)
        {
            ListViewItem.ListViewSubItem subitem = new ListViewItem.ListViewSubItem();
            subitem.Text = s;
            item.SubItems.Add(subitem);
        }

        this.listView1.Items.Add(item);
    }
}
See Also

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)