Xceed Zip Compression Library Documentation
Listing the contents of a zip file by collection (C# example)
Example topics > Listing the contents of a zip file by collection (C# example)
 
XAML Copy Code

XceedZipLib.XceedZip zip = new XceedZipLib.XceedZipClass();

zip.License( @"your license key" );

// Specify which files are to be listed.
// Setting this property to string.Empty
// we result in all the files being listed.
zip.FilesToProcess = string.Empty; 

// Specify the name and location of the zip file.
zip.ZipFilename = @"d:\fonts.zip"; 

// Get a listing of the files
object zipItems = null; 

XceedZipLib.xcdError result = zip.GetZipContents( ref zipItems, XceedZipLib.xcdContentsFormat.xcfCollection ); 

// Iterate through the collection
foreach( XceedZipLib.XceedZipItem item in ( XceedZipLib.XceedZipItems )zipItems )
{
   listBox1.Items.Add( item.Filename );

MessageBox.Show( zip.GetErrorDescription( XceedZipLib.xcdValueType.xvtError, ( int )result ) );