PowerTCP Zip Compression for .NET
Item Property (Archive)
Example 




The zero-based index of the element to get or set.
Gets or sets the object at the specified index.
Syntax
<BrowsableAttribute(False)>
Public Default Property Item( _
   ByVal index As Integer _
) As ArchiveItem
Dim instance As Archive
Dim index As Integer
Dim value As ArchiveItem
 
instance.Item(index) = value
 
value = instance.Item(index)
[Browsable(false)]
public ArchiveItem this[ 
   int index
]; {get; set;}
[Browsable(false)]
public: __property ArchiveItem* get_Item   int index
;
public: __property void set_Item   int index,
   ArchiveItem* value
;
[Browsable(false)]
public:
property ArchiveItem^ default [int] {
   ArchiveItem^ get(int index);
   void set (int indexArchiveItem^ value);
}

Parameters

index
The zero-based index of the element to get or set.

Property Value

The object at the specified index.
Remarks

This property provides the ability to access a specific element in the collection by using the following syntax:

					myArchive[index].
					

Example
The following example demonstrates unzipping from an individual ArchiveItem.
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Zip"
' at the top of your class.

' Open a compressed stream.  This populates the Archive collection.
Archive1.Open("c:\test.zip")

If (Archive1.Count > 1) Then

    ' Unzip the first item in the collection to a file, preserving its path
    Archive1(0).Unzip("c:\Test", True, Overwrite.Always)

    ' Unzip the second item in the collection to a memory stream
    Dim stream = New System.IO.MemoryStream()
    Archive1(1).Unzip(stream)
End If
// Be sure to import the namespace by putting "using Dart.PowerTCP.Zip;"
// at the top of your class.

// Open a compressed stream.  This populates the Archive collection.
archive1.Open("c:\\test.zip");

if (archive1.Count > 1)
{
	// Unzip the first item in the collection to a file, preserving its path
	archive1[0].Unzip("c:\\Test", true, Overwrite.Always);

	// Unzip the second item in the collection to a memory stream
	System.IO.MemoryStream stream = new System.IO.MemoryStream();
	archive1[1].Unzip(stream);
}
See Also

Reference

Archive Class
Archive Members


PowerTCP Zip for .NET Documentation Version 2.1.1
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic