ComponentOne

Zip for .NET

Copyright © 1987-2015 GrapeCity, Inc. All rights reserved.

ComponentOne, a division of GrapeCity
201 South Highland Avenue, Third Floor
Pittsburgh, PA 15206 USA

Website:
Sales:
Telephone:

http://www.componentone.com
sales@componentone.com
1.800.858.2739 or 1.412.681.4343 (Pittsburgh, PA USA Office)

Trademarks
The ComponentOne product name is a trademark and ComponentOne is a registered trademark of GrapeCity, Inc.
All other trademarks used herein are the properties of their respective owners.

Warranty
ComponentOne warrants that the media on which the software is delivered is free from defects in material and
workmanship, assuming normal use, for a period of 90 days from the date of purchase. If a defect occurs during this
time, you may return the defective media to ComponentOne, along with a dated proof of purchase, and
ComponentOne will replace it at no charge. After 90 days, you can obtain a replacement for the defective media by
sending it and a check for $25 (to cover postage and handling) to ComponentOne.
Except for the express warranty of the original media on which the software is delivered is set forth here,
ComponentOne makes no other warranties, express or implied. Every attempt has been made to ensure that the
information contained in this manual is correct as of the time it was written. ComponentOne is not responsible for
any errors or omissions. ComponentOne’s liability is limited to the amount you paid for the product. ComponentOne
is not liable for any special, consequential, or other damages for any reason.

Copying and Distribution
While you are welcome to make backup copies of the software for your own use and protection, you are not
permitted to make copies for the use of anyone else. We put a lot of time and effort into creating this product, and
we appreciate your support in seeing that it is used by licensed users only.

Table of Contents
Zip for .NET Overview .............................................................................................................. 9
Help with WinForms Edition ................................................................................................ 9
Creating a Mobile Device Application................................................................................... 9
Migrating a Zip for .NET Project to Visual Studio 2005........................................................ 10
Key Features .......................................................................................................................... 11
Zip for .NET Fundamentals..................................................................................................... 13
High Level: C1ZipFile, C1ZipEntry and C1ZipEntryCollection Classes ................................... 13
Medium Level: C1ZStreamReader and C1ZStreamWriter Classes ....................................... 15
Low Level: ZStream Class ................................................................................................... 17
Zip for Mobile Devices Fundamentals .................................................................................... 17
Zip for .NET Samples .............................................................................................................. 18
Zip for .NET Task-Based Help ................................................................................................. 19
Compressing Datasets ....................................................................................................... 20
Compressing an Entire Folder into a Zip File....................................................................... 22
Creating a Zip File with Multiple Entries ............................................................................. 23
Extracting Files from Zip Entry to Memory ......................................................................... 24
Reading a Zipped File Using a StreamReader...................................................................... 25
Retrieving Images from a Zip File ....................................................................................... 26
Saving a String Variable to a Zip File ................................................................................... 29
Setting the Level of Compression ....................................................................................... 31
Using Passwords to Protect Zip Files .................................................................................. 31
Zip for .NET Tutorials ............................................................................................................. 33
Compressing Data in Memory ............................................................................................ 34
Compressing Files .............................................................................................................. 45
Compressed Serialization ................................................................................................... 55
Handling Zip Files ............................................................................................................... 65
Zip for .NET Frequently Asked Questions ............................................................................... 82
API Reference ........................................................................................................................ 82
C1.C1Zip.4 Assembly.......................................................................................................... 82
Namespaces .................................................................................................................. 82
C1.C1Zip Namespace.................................................................................................. 82
Overview................................................................................................................ 82

Classes ................................................................................................................... 84
C1ZipEntry.......................................................................................................... 84
Overview ........................................................................................................ 84
Members ........................................................................................................ 85
Methods ......................................................................................................... 87
CheckCRC32 Method .................................................................................. 87
CheckPassword Method ............................................................................. 88
Extract Method........................................................................................... 89
OpenReader Method .................................................................................. 90
Remove Method ......................................................................................... 90
Properties ....................................................................................................... 91
Attributes Property ..................................................................................... 92
Comment Property ..................................................................................... 92
CRC32 Property .......................................................................................... 93
Date Property ............................................................................................. 93
FileName Property ...................................................................................... 94
IsEncrypted Property .................................................................................. 95
SizeCompressed Property ........................................................................... 95
SizeCompressedLong Property .................................................................... 96
SizeUncompressed Property ....................................................................... 96
SizeUncompressedLong Property ................................................................ 97
C1ZipEntryCollection .......................................................................................... 98
Overview ........................................................................................................ 98
Members ........................................................................................................ 99
Methods ........................................................................................................100
Add Method ..............................................................................................101
Add(String) Method ...............................................................................102
Add(String[]) Method .............................................................................102
Add(String,Int32) Method ......................................................................103
Add(String,String) Method .....................................................................104
Add(String,String,DateTime) Method .....................................................106
Add(Stream,String) Method ...................................................................107
Add(Stream,String,DateTime) Method ...................................................108
AddFolder Method ....................................................................................109

AddFolder(String) Method .....................................................................109
AddFolder(String,String) Method ...........................................................110
AddFolder(String,String,Boolean) Method ..............................................111
Contains Method .......................................................................................113
Contains(String) Method ........................................................................113
Contains(C1ZipEntry) Method ................................................................114
Extract Method..........................................................................................115
Extract(Int32,String) Method..................................................................115
Extract(String,String) Method.................................................................116
Extract(Int32) Method............................................................................117
Extract(String) Method...........................................................................118
ExtractFolder Method ................................................................................119
IndexOf Method ........................................................................................120
IndexOf(String) Method .........................................................................121
IndexOf(C1ZipEntry) Method .................................................................121
OpenWriter Method ..................................................................................122
OpenWriter(String,Boolean) Method .....................................................123
OpenWriter(String,DateTime,Boolean) Method .....................................124
Remove Method ........................................................................................125
Remove(Int32) Method ..........................................................................126
Remove(String) Method .........................................................................127
Remove(Int32[]) Method .......................................................................127
Remove(String[]) Method ......................................................................128
Properties ......................................................................................................129
Count Property ..........................................................................................129
Item Property ............................................................................................130
Item(Int32) Property ..............................................................................131
Item(String) Property .............................................................................131
C1ZipFile............................................................................................................132
Overview .......................................................................................................134
Members .......................................................................................................135
C1ZipFile Constructor ....................................................................................137
C1ZipFile Constructor() ..............................................................................138
C1ZipFile Constructor(String,Boolean)........................................................139

......................................142 Close Method .....Boolean) .................................................................................154 Properties ....157 MemoryThreshold Property...............................................................................................................................................................................................................................................................159 OverwriteReadOnly Property ...........................160 TempFileName Property .........151 OpenBatch Method ..........................................................................................................................................................................................................................................................153 Refresh Method..................................................................................................................................................................175 Overview .................156 CompressionLevel Property ...........................................................140 C1ZipFile Constructor(Stream..................................................................................145 Create(Stream) Method ............................................................156 Entries Property ............................................146 IsZipFile Method ..........................143 CloseBatch Method ................173 Events........................................................................................145 Create(String) Method .................................................................................................154 Comment Property ......142 Methods ........................................................................................147 IsZipFile(String) Method .....177 Members .....................................141 C1ZipFile Constructor(Stream) ......149 Open Method ........................................................................................................................................................................................................................................................................................................................................................................................................................................................C1ZipFile Constructor(String) ...........................................178 ............................................150 Open(Stream) Method .............158 OverwriteHidden Property ..174 Progress Event ............................................................148 IsZipFile(Stream) Method ...........................................160 Password Property..................157 FileName Property ......................144 Create Method .........................................................................................................................................................................................................................159 OverwriteSystem Property........................................................................................................173 UseUtf8Encoding Property.........................................................175 C1ZStreamReader...............................................................................................................................................................................................................................................................149 Open(String) Method ..........................

...............................................................................................192 ReadByte Method ...................200 OwnsBaseStream Property ..............................................202 SizeUncompressedLong Property ............190 Flush Method .........................................................Boolean).........188 Methods .............................................................................Boolean.....186 C1ZStreamReader Constructor(Stream..................210 C1ZStreamWriter Constructor(Stream) ............................................182 C1ZStreamReader Constructor(Stream...........................................................................................Boolean)......Int32) ........................................................................................................................................................................194 Write Method ........................................................211 C1ZStreamWriter Constructor(Stream..................................................204 Overview ...........................Boolean) ......194 SetLength Method .................................................212 ...........................................193 Seek Method .........................................C1ZStreamReader Constructor.....206 Members .................................Boolean...............Boolean..........................................................................................................................203 C1ZStreamWriter....................................................................................202 SizeUncompressed Property .......................189 Close Method ..183 C1ZStreamReader Constructor(Stream........................................................................................198 CanSeek Property ...................................................203 ZStream Property.................................................Boolean.......185 C1ZStreamReader Constructor(Stream............................................................197 CanRead Property .............................................................................................................................................Int32...........................191 Read Method..........................................................................................................Int32) ...............................................................................................................201 SizeCompressed Property .........................................................................................................................................................Int64......................................Int32)...................199 Length Property ...............................................184 C1ZStreamReader Constructor(Stream....................................................................................................181 C1ZStreamReader Constructor(Stream) ..............................................................207 C1ZStreamWriter Constructor..........195 Properties .....................................................196 BaseStream Property ........................................198 CanWrite Property .........................................200 Position Property ............201 SizeCompressedLong Property ................................................................................................................

C1ZStreamWriter Constructor(Stream,Boolean,Boolean) ...........................213
C1ZStreamWriter Constructor(Stream,CompressionLevelEnum) ................214
C1ZStreamWriter Constructor(Stream,CompressionLevelEnum,Boolean) ..215
C1ZStreamWriter
Constructor(Stream,CompressionLevelEnum,Boolean,Boolean).................216
Methods ........................................................................................................218
Close Method ............................................................................................219
Flush Method ............................................................................................220
Read Method.............................................................................................220
Seek Method .............................................................................................221
SetLength Method .....................................................................................222
Write Method ............................................................................................223
WriteByte Method .....................................................................................224
Properties ......................................................................................................225
BaseStream Property .................................................................................226
CanRead Property ......................................................................................227
CanSeek Property ......................................................................................227
CanWrite Property .....................................................................................228
Checksum Property....................................................................................228
Length Property .........................................................................................229
OwnsBaseStream Property ........................................................................230
Position Property .......................................................................................230
SizeCompressed Property ..........................................................................231
SizeCompressedLong Property ...................................................................231
SizeUncompressed Property ......................................................................232
SizeUncompressedLong Property ...............................................................232
ZStream Property.......................................................................................233
ZipFileException ................................................................................................234
Overview .......................................................................................................235
Members .......................................................................................................235
ZipFileException Constructor .........................................................................237
ZipFileException Constructor(String) ..........................................................237
ZipFileException Constructor(String,String) ................................................238
ZipFileException Constructor(String,String,Exception) ................................239

ZipProgressEventArgs ........................................................................................240
Overview .......................................................................................................241
Members .......................................................................................................242
Properties ......................................................................................................243
Cancel Property .........................................................................................243
FileLength Property....................................................................................244
FileLengthLong Property ............................................................................244
FileName Property .....................................................................................245
Position Property .......................................................................................245
PositionLong Property................................................................................246
Enumerations ........................................................................................................246
CompressionLevelEnum ....................................................................................246
Delegates ..............................................................................................................247
ZipProgressEventHandler ..................................................................................247
C1.C1Zip.ZLib Namespace .........................................................................................248
Overview...............................................................................................................248
Classes ..................................................................................................................249
ZStream.............................................................................................................249
Overview .......................................................................................................250
Members .......................................................................................................251
ZStream Constructor......................................................................................254
ZStream Constructor() ...............................................................................254
ZStream Constructor(Boolean)...................................................................255
Methods ........................................................................................................256
deflate Method..........................................................................................257
deflateEnd Method ....................................................................................258
deflateInit Method.....................................................................................259
deflateInit(Int32) Method ......................................................................259
deflateInit(Int32,Int32) Method .............................................................260
deflateParams Method ..............................................................................262
deflateSetDictionary Method .....................................................................262
inflate Method...........................................................................................264
inflateEnd Method .....................................................................................265
inflateInit Method......................................................................................266

inflateInit() Method ...............................................................................266
inflateInit(Int32) Method .......................................................................267
inflateSetDictionary Method ......................................................................268
inflateSync Method....................................................................................269
Fields .............................................................................................................270
adler Field..................................................................................................271
avail_in Field..............................................................................................272
avail_out Field ...........................................................................................273
msg Field ...................................................................................................273
next_in Field ..............................................................................................274
next_in_index Field ....................................................................................274
next_out Field............................................................................................275
next_out_index Field .................................................................................275
total_in Field..............................................................................................276
total_out Field ...........................................................................................276
Z_BUF_ERROR Field ...................................................................................277
Z_DATA_ERROR Field .................................................................................278
Z_ERRNO Field ...........................................................................................278
Z_MEM_ERROR Field .................................................................................279
Z_NEED_DICT Field ....................................................................................279
Z_OK Field .................................................................................................280
Z_STREAM_END Field ................................................................................280
Z_STREAM_ERROR Field ............................................................................281
Z_VERSION_ERROR Field............................................................................281
ZStreamException .............................................................................................282
Overview .......................................................................................................283
Members .......................................................................................................284

Zip for .NET Overview
Quickly compress data, saving disk space and network bandwidth,
and easily manipulate and work with compressed data. Zip for .NET
allows you to compress files from your applications, including system
and hidden files, and add and delete compressed files and folders;
you can even read and write to zip files stored in streams.

Getting Started
To get started, review
the following topics:

Zip for .NET classes are supported in all .NET development platforms

Key Features

including WinForms, ASP.NET, WPF, Mobile, and a special Silverlight

Zip for .NET
Fundamentals

version exists in Silverlight Edition.

Samples

See Also
Help with WinForms Edition
Creating a Mobile Device Application
Migrating a Zip for .NET Project to Visual Studio 2005

Help with WinForms Edition
Getting Started
For information on installing ComponentOne Studio WinForms Edition, licensing, technical
support, namespaces and creating a project with the control, please visit Getting Started with
WinForms Edition.

Creating a Mobile Device Application
To create a new .NET 2.0 device application project, complete the following steps:
1.
2.
3.

From the File menu in Microsoft Visual Studio .NET, select New | Project. The New
Project dialog box opens.
Under Project Types, expand the Visual Basic or Visual C# node. Note that one of
these options may be located under Other Languages.
Expand the Smart Device node and select one of the smart devices listed.

4.

Select Device Application from the list of Templates in the right pane.

5.

Enter a name in the Name textbox and click OK. A new project is created, and a new
Form1 is displayed in the Designer view.
Reference the C1Zip assembly in your project.

6.

Migrating a Zip for .NET Project to Visual
Studio 2005
To migrate a project using ComponentOne components to Visual Studio 2005, there are two
main steps that must be performed. First, you must convert your project to Visual Studio 2005,
which includes removing any references to a previous assembly and adding a reference to the
new assembly. Second, you must update the project References to use the new C1.C1Zip.2.dll.

To convert the project:
1.
2.
3.
4.
5.
6.
7.
8.

Open Visual Studio 2005 and select File | Open | Project/Solution.
Locate the .sln file for the project that you wish to convert to Visual Studio 2005. Select
it and click Open. The Visual Studio Conversion Wizard appears.
Click Next.
Select Yes, create a backup before converting to create a backup of your current
project and click Next.
Click Finish to convert your project to Visual Studio 2005. The Conversion Complete
window appears.
Click Show the conversion log when the wizard is closed if you want to view the
conversion log.
Click Close. The project opens. Now you must remove references to any of the previous
ComponentOne .dlls and add references to the new ones.
Go to the Solution Explorer (View | Solution Explorer), select the project, and click the
Show All Files button.
Note: The Show All Files button does not appear in the Solution Explorer toolbar if the
Solution project node is selected.

9. Expand the References node, right-click C1.C1Zip and select Remove.
10. Right-click the References node and select Add Reference.
11. Locate and select C1.C1Zip.2.dll. Click OK to add it to the project.

o Specify the path where files will be uncompressed to.Key Features Some of the main features of Zip for . and easily manipulate compressed files by deleting files from within a zip file. o Work on temporary copies of zip files.  Read and Write to Streams Zip can read and write to zip files stored in streams in addition to actual files using the C1ZipFile. you can:  o Obtain global information on a zip file. o Add and retrieve comments for individual files in the zip file. o Test the integrity of a zip file and its contents. for maximum safety. . You can also control file information by adding and retrieving comments and control path information for individual entries in the zip file. controlling the amount of compression applied to files being zipped. o Control the amount of compression applied to files being zipped. o Get and set the global zip file comment. o Zip system and hidden files. and getting and setting the global zip file comment.NET that you may find useful include the following:  Major operations With Zip for . This allows reading zip files embedded in application resources or stored in database fields instead of in actual files. Compress and Expand Folders With Zip you can easily compress and expand folders while preserving folder structure. and specifying the path where files will be uncompressed to. including system and hidden files.  File Integrity and Safety With Zip you can test the integrity of a zip file and its contents and work on temporary copies of zip files to ensure maximum safety.NET.  Get and Set File Information Easily obtain zip file information including a detailed list of the zip file's contents. o Control what path information is stored in the zip file for each file. o Obtain a detailed list of a zip file's contents via a collection object.  Compress and Manipulate Compressed Files Compress files. o Delete files from within a zip file.Open(Stream) method.

without dealing with byte arrays. intuitive object model Zip for .) ZLIB's memory footprint is also independent of the input data.223. The maximum uncompressed entry size is 9. or any other type of stream.854.372.775.483. Unlike Unix compress and GIF image format LZW compression. without dealing with byte arrays. low memory usage compression engine The low memory compression engine lets you:  o Zip files or memory buffers into new or existing zip files. C1ZStreamReader is a stream object that takes a compressed stream as input and decompresses it as it reads data from the underlying compressed stream. Unlike the LZW compression method used in Unix compress and in the GIF image format. and writes it out to an underlying stream.  Support for Zip64 C1Zip now supports Zip64 files. ZLIB is designed to be a free. You can compress data to files. lossless data-compression library for use on virtually any computer hardware and operating system. The maximum number of entries per ZIP file is 2.647 (int. You can attach a BinaryReader object to C1ZStreamReader to read objects directly. 100% managed C# code C1. o Stream-based compression and decompression for maximum flexibility.036. o Compress and decompress strings or buffers completely in memory. general-purpose. (LZW can double or triple the file size in extreme cases.NET contains three main classes:   C1ZStreamWriter is a stream object that takes regular data on input.C1Zip. The ZLIB data format is itself portable across platforms.807 (long.147. crossplatform data format. the compression method currently used in ZLIB essentially never expands the data. . You can attach a BinaryWriter object to C1ZStreamWriter to write objects directly. ZLIB handles the actual data compression and decompression. compresses it. o Unzip files to disk or directly to memory.MaxValue).MaxValue). the ZLIB compression method essentially never expands the data (LZW doubles or triples the file size in extreme cases) and has a memory footprint independent of input data.  Simple. Incorporates the ZLIB Advantage ZLIB is a general-purpose. lossless data-compression library with a portable.ZLib is a C# implementation of Adler and Gailly's ZLIB code and contains a main class ZStream that handles stream-based compression and decompression.  Fast. This allows for entries longer than the usual 4 gig limit and also allows more entries per zip file. memory.

C1ZipEntryCollection You can inspect the contents of ZIP files. Medium C1ZStreamReader. open. C1ZipFile has a Entries property that represents a collection of entries in a zip file. test their integrity. and network streams). Zip for . and extract entries to and from ZIP files. C1ZipFile Class . You can compress the data.NET streams (including memory. open. C1ZipEntry and C1ZipEntryCollection Classes Medium Level: C1ZStreamReader and C1ZStreamWriter Classes Low Level: ZStream Class High Level: C1ZipFile. and modify zip files. delete. See Also High Level: C1ZipFile. add. Low ZStream This is the lowest level class in C1Zip. supported by many popular applications. and manage ZIP files. file. C1ZipEntry. Use these classes to create. the popular data-compression library written by Jean-loup Gailly and Mark Adler. The zip format is an open standard. They allow you to create and manage zip files.NET Fundamentals The classes in the C1Zip library are divided into three levels: Level Main Classes Description High C1ZipFile. ZStream is used by the higher level classes in C1Zip. It allows you to create. C1ZStreamWriter Use these classes to compress and expand data into and out of regular . C1ZipFile is a class that deals with zip files. making application deployment easier. C1ZipEntry and C1ZipEntryCollection Classes These are the highest level classes in the C1Zip library. saving disk space and network bandwidth. Using zip files to store application data provides the following benefits:    You can consolidate many files into one. It is a 100% C# implementation of Zlib.

doc") Dim zipEntry As C1ZipEntry For Each zipEntry In myZip.xml") myZip.Create("New. // Open an existing zip file. myZip.WriteLine(zipEntry. use the Entries collection to inspect the contents of the zip file. For example: To write code in Visual Basic Visual Basic Copy Code myZip. After you create a C1ZipFile object. myZip. and delete entries.Create("New.Entries. C1ZipEntryCollection Class After you have created or opened a zip file. or to add. myZip.Open("Old.txt") myZip.Entries. expand. you can attach it to an existing zip file or tell it to create a new empty zip file for you.zip").zip") To write code in C# C# Copy Code // Create a C1ZipFile object.Entries Console. Dim myZip As New C1ZipFile() ' Create a new (empty) zip file.Add("MyData. For example: To write code in Visual Basic Visual Basic Copy Code ' Create a C1ZipFile object.Add("MyData.Entries. C1ZipFile myZip = new C1ZipFile().zip").FileName) Next zipEntry . myZip.Open("Old. // Create a new (empty) zip file.The C1ZipFile class encapsulates a zip file.zip") ' Open an existing zip file.Add("MyData.

NET streams.doc"). size. The diagram below illustrates how it works: .xml").Add("MyData.Add("MyData. C1ZipEntry Class The C1ZipEntry class exposes properties and methods that describe each entry.zip").Entries. myZip. The data is compressed (or expanded) on the fly into (or out of) the underlying stream. Medium Level: C1ZStreamReader and C1ZStreamWriter Classes The C1ZStreamReader and C1ZStreamWriter classes allow you to use data compression on any . not only in zip files. attach them to regular streams and read or write the data through them.Entries. including its original file name.NET streams.WriteLine(zipEntry.Entries) Console.myZip.Add("MyData.Open("Old. To use C1ZStreamReader and C1ZStreamWriter objects. so you can read the entry contents without expanding it first. and so on. myZip. It also has a OpenReader method that returns a stream object.txt").FileName). foreach (C1ZipEntry zipEntry in myZip. This design allows great integration with native . compressed size. To write code in C# C# Copy Code myZip.Entries.

Serialize(fout.Formatters.Formatters.Close() ' Read the compressed data. FileStream fout = new FileStream("test.Create) Dim compressor As New C1ZStreamWriter(fout) bf. DataTableOut) fout. System.Serialization.Binary. FileMode. the code below saves an ADO. FileMode.Serialization.BinaryFormatter() Dim fout As New FileStream("test.BinaryFormatter bf = new System.tmp". FileMode.Close().Runtime.Binary. DataTableOut). you would simply add two lines of code: To write code in Visual Basic Visual Basic Copy Code ' Save the DataTable into a compressed stream.Serialize(compressor. bf.Create). // Read the compressed data.Serialization.Runtime. DataTableOut) .BinaryFormatter().Binary. DataTable DataTableIn = (DataTable)bf.Open) Dim DataTableIn As DataTable = bf. FileMode. Dim bf As New Runtime.tmp".tmp". To add data compression.Deserialize(fin) To write code in C# C# Copy Code // Save the DataTable into compressed stream.Deserialize(fin).tmp". FileMode.Binary. Dim fin As New FileStream("test.NET DataTable object into a stream and then reads it back: To write code in Visual Basic Visual Basic Copy Code ' Save the DataTable into a compressed stream.tmp".For example. Dim bf As New Runtime.Open).Serialize(fout.BinaryFormatter() Dim fout As New FileStream("test.Serialization.Create) bf.Formatters.Formatters. FileStream fin = new FileStream("test. fout.

FileMode.Binary. and it is used extensively by the higher-level classes described above.BinaryFormatter bf = new System.Close() ' Read the compressed data. ZStream is a C# implementation of the ZLIB library.Runtime.Binary.gzip. System.Serialize(compressor.fout.NET Compact Framework-based applications for your mobile devices. It implements several classes that allow you to add data compression to your applications. For more information on ZLIB.Formatters. DataTable DataTableIn = (DataTable)bf.Open) Dim decompressor As New C1ZStreamReader(fin) Dim DataTableIn As DataTable = bf.Runtime. ZLIB is an open-source library written by Jean-loup Gailly and Mark Adler.Formatters. such as personal digital assistants (PDA's).Deserialize(decompressor). FileStream fin = new FileStream("test.Open). DataTableOut).Deserialize(decompressor) To write code in C# C# Copy Code // Save the DataTable into a compressed stream.tmp".Close(). mobile phones.BinaryFormatter(). It is the most flexible. FileStream fout = new FileStream("test. Zip for Mobile Devices Fundamentals The mobile version of Zip for . C1ZStreamWriter compressor = new C1ZStreamWriter(fout). Most users will never need to use ZStream directly. C1ZStreamReader decompressor = new C1ZStreamReader(fin).org/ or http://www.Serialization. and more. bf. FileMode. but the hardest to use component in the C1Zip library.NET allows you to quickly develop Microsoft. . Low Level: ZStream Class This is the lowest-level class in the C1Zip library.Create).info-zip.tmp".Serialization. FileMode. fout. check http://www. // Read compressed data.org/.tmp". Dim fin As New FileStream("test.

aspx.Zip for Mobile supports all members of the object model that are supported by the . This sample calls the C1. This sample calls the C1.NET Samples Please be advised that this ComponentOne software tool is accompanied by various sample projects and/or demos. open.com/Samples.C1Zip namespace. they are installed with Zip for Mobile Devices.NET Compact Framework. This sample lets you create. Note that the code examples provided in this documentation are examples for using Zip for . Memory Shows how to compress and expand memory streams. and edit standard zip files. which may make use of other development tools included with ComponentOne Studio Enterprise. Please refer to the pre-installed product samples through the following path: Documents\ComponentOne Samples\WinForms Click one of the following links to view a list of C1Zip samples: Visual Basic Samples Sample Description Files Shows how to compress and expand individual files. ZipFileDemo Shows how to implement a simple zip utility.C1Zip namespace. If you would like to see samples for the mobile version. or you can get them online at http://helpcentral. Zip for . This sample uses the C1. Note that this is a stripped-down version of the ZipFileDemo sample.NET serialization support. C# Samples .C1Zip namespace.C1Zip namespace.NET. Serialization Shows how to add compression to the .componentone. ZipFileSimple Shows how to implement a simple zip utility. This sample calls the C1.

C1Zip namespace. This sample calls the C1.C1Zip namespace. This sample calls the C1. This sample calls the C1. Zip for Mobile Devices Samples (Visual Basic and C#) Sample Description DataSet Add compression to the .NET serialization support.C1Zip namespace.NET Task-Based Help The task-based help section assumes that you are familiar with programming in the Visual Studio environment. InMemoryCompression Shows how to create and use an in-memory archive. ZipImages Shows how to retrieve images directly from a zip file. This sample calls the C1. This sample calls the C1. SelfExtract Self-extracting application. Zip for .Sample Description Files Shows how to compress and expand individual files.NET Tutorials first. This sample uses the C1. Memory Shows how to compress and expand memory streams.C1Zip namespace.C1Zip namespace. ZipFileDemo Shows how to implement a simple zip utility.C1Zip namespace. This sample calls the C1. This sample calls the C1.C1Zip namespace. If you are a novice to C1Zip.C1Zip namespace. ZipFile Implement a simple zip utility. LongString Compress and expand strings.C1Zip namespace. This sample calls the C1.NET serialization support. Serialization Shows how to add compression to the . This sample calls the C1. . see the Zip for .C1Zip namespace.

WriteXml(s.DataSetName. use the following code: To write code in Visual Basic Visual Basic Copy Code Private Sub SaveDataSet(ds As DataSet) ' Open/create zip file.C1ZipFile() zip.C1Zip.C1ZipFile() .Entries.Dispose() End Try End Sub Private Sub CheckDataSet(ds As DataSet) ' Open/create zip file.zip") ' Write the dataset into the zip file. Dim s As Stream = zip. XmlWriteMode.C1Zip namespace. Each topic also assumes that you have created a new . See Also Compressing Datasets Compressing an Entire Folder into a Zip File Creating a Zip File with Multiple Entries Extracting Files from Zip Entry to Memory Reading a Zipped File Using a StreamReader Retrieving Images from a Zip File Saving a String Variable to a Zip File Setting the Level of Compression Using Passwords to Protect Zip Files Compressing Datasets To write a dataset into a compressed zip file. True) Try ds.OpenWriter(ds. Dim zip As New C1.NET project. Dim zip As New C1.C1Zip.Open("c:\temp\dataset.WriteSchema) Finally s.Each task-based help topic provides a solution for specific tasks referencing the C1.

zip.zip").C1Zip.Tables(i) Dim dt2 As DataTable = dsTest.C1Zip.Open(@"c:\temp\dataset.C1ZipFile(). zip.Open("c:\temp\dataset.Rows.Entries.C1Zip.C1ZipFile zip = new C1.OpenWriter(ds.Tables(i) Debug.Entries(ds.zip").C1ZipFile(). Dim dsTest As New DataSet(ds.WriteSchema).C1Zip. } } private void CheckDataSet(DataSet ds) { // Open/create zip file.DataSetName.zip") ' Read the dataset from the zip file.TableName = dt2.Dispose() End Try ' Check that the datasets are equivalent.Columns.Count . C1.ReadXml(s) Finally s. C1.Rows.DataSetName) ' Dim s As Stream = zip. // Write the dataset into the zip file.OpenReader() Try dsTest.WriteXml(s.1 Dim dt1 As DataTable = ds.Count = dt2. Dim i As Integer For i = 0 To ds.Columns.Count)) Next i End Sub To write code in C# C# Copy Code private void SaveDataSet(DataSet ds) { // Open/create zip file.DataSetName). true)) { ds.Count And dt1.C1ZipFile zip = new C1.Tables. . XmlWriteMode.TableName And dt1.Open(@"c:\temp\dataset. using (Stream s = zip.Assert((dt1.Count = dt2. zip.

including all subfolders.Debug.Rows. DataTable dt2 = dsTest.Count.AddFolder("c:\temp###BOT_TEXT###quot;. "*.ReadXml(s).Entries. } } Compressing an Entire Folder into a Zip File To compress an entire folder into a zip file.OpenReader()) { dsTest. use the following code: . DataSet dsTest = new DataSet(ds.*".TableName && dt1.Tables. for (int i = 0.Entries[ds. use the AddFolder method. i < ds.Count && dt1.Count == dt2.Diagnostics. using (Stream s = zip. For example.Assert(dt1. True) To write code in C# C# Copy Code C1Zip.AddFolder(@"c:\temp###BOT_TEXT###quot;.Entries.DataSetName].Count == dt2. "*.Rows. i++) { DataTable dt1 = ds.Columns.// Read the dataset from the zip file. System. use the following code: To write code in Visual Basic Visual Basic Copy Code C1Zip. true). To extract the folder later. preserving the folder structure for later expansion.DataSetName). } // Check that the datasets are equivalent. to compress the contents of the "c:\temp" folder.*". including the original folder structure.Tables[i].Columns.Count).Tables[i].TableName == dt2.

sw.ExtractFolder("c:\temp###BOT_TEXT###quot;) To write code in C# C# Copy Code C1Zip..OpenWriter("entry2". Add the following code to the Click event: To write code in Visual Basic Visual Basic Copy Code Private Sub Button1_Click(ByVal sender As System. use the OpenWriter method..WriteLine("Hello again") ' Continue writing as much as you want. That returns a stream that you can write to.OpenWriter("entry1".Object.zip") Dim s As Stream = zip.ExtractFolder(@"c:\temp###BOT_TEXT###quot;).WriteLine("Hello world") ' Continue writing as much as you want.To write code in Visual Basic Visual Basic Copy Code C1Zip. True) sw = New StreamWriter(s) sw..Create("c:\temp\test.Entries.Close() s = zip. Creating a Zip File with Multiple Entries To stream multiple XML files directly into the zip file. and when the stream is closed it is added to the zip file.Entries. True) Dim sw As New StreamWriter(s) sw.EventArgs) Handles Button1. ByVal e As System.Entries.. sw.Entries.Close() End Sub .Click Dim zip As New C1ZipFile() zip.

// Continue writing as much as you want.Close(). Syntax Visual Basic (Declaration) Public Property TextCaptionText As System.. sw.EventArgs e) { C1ZipFile zip = new C1ZipFile(). set. true).Entries.WriteLine("Hello again").Entries. // Continue writing as much as you want. zip.string TextCaptionText {get. sw. sw.WriteLine("Hello world").OpenWriter("entry2". Extracting Files from Zip Entry to Memory Gets or sets the text of the caption of the "Text" column in the result list.} Requirements .String C# public System.OpenWriter("entry1".. } To read an entry without saving it to a file. sw = new StreamWriter(s).Close(). true).To write code in C# C# Copy Code private void button1_Click(object sender... Note: OpenWriter is a member of the C1ZipEntryCollection class.Create(@"c:\temp\test.zip"). use the OpenReader method on the entry object. System. Stream s = zip. while OpenReader is a member of the C1ZipEntry class. sw. s = zip. StreamWriter sw = new StreamWriter(s).

Open("c:\temp\myzipfile.zip") ' Open an input stream on any entry.Entries["someFile.cs") Dim s As Stream = ze. Dim zip As New C1ZipFile() zip. Windows Server 2008 R2 (Server Core supported with SP1 or later).zip"). Windows XP SP3.Target Platforms: Windows 7. Stream s = ze. Dim sr As New StreamReader(s) ' Use the StreamReader. then close it. Dim ze As C1ZipEntry = zip. Windows Vista SP1 or later. To write code in C# C# Copy Code // Open a zip file. // Open an input stream on any entry.Entries("someFile. . add the following code: To write code in Visual Basic Visual Basic Copy Code ' Open a zip file.Open(@"c:\temp\myzipfile. zip. Windows Server 2003 SP2 See Also Reference C1PreviewTextSearchPanel Class C1PreviewTextSearchPanel Members Reading a Zipped File Using a StreamReader To read a zipped file using a StreamReader. C1ZipFile zip = new C1ZipFile().OpenReader(). C1ZipEntry ze = zip. Windows Server 2008 (Server Core not supported).OpenReader() ' Open the StreamReader on the stream.cs"].

IndexOf("\bin")) + "\resources" ' Create the zip file.GetFiles(s) Dim fname As String = f. Dim s As String = Application. Dim zip As New C1ZipFile() Form1_Load(ByVal sender As System.Load ' Get the application directory. zip.GetFileName(fname)) ' Add to the zip file.Add(fname) ContinueForEach1: Next f End Sub .Add(Path.Substring(0.EventArgs) Handles MyBase. s. // Use the StreamReader.EndsWith("zip") Then GoTo ContinueForEach1 End If ' Add to the list. If fname. ListBox1. then close it.Create((s + "\images.ToLower() ' Skip self. Retrieving Images from a Zip File To retrieve images directly from a zip file. first add the following code to the Form_Load event to compress several image files into a zip file: To write code in Visual Basic Visual Basic Copy Code ' Build a list of images in resource directory.Items. zip. Dim f As String For Each f In Directory.zip")) ' Populate the zip file and list.Object.// Open the StreamReader on the stream. and add them all to a zip file.ExecutablePath s = s.Entries. ByVal e As System. StreamReader sr = new StreamReader(s).

GetFiles(s)) { string fname = f.To write code in C# C# Copy Code // Build a list of images in resource directory. if (fname.IndexOf(@"\bin")) + @"\resources".EndsWith("zip")) continue. // Create the zip file.ToLower().Substring(0.zip"). string s = Application. foreach (string f in Directory.Add(Path.Entries. // Skip self. } } To allow you to select an image.ExecutablePath.Items.Add(fname). private void Form1_Load(object sender.EventArgs e) { // Get the application directory. add the following code to the SelectedIndexChanged event: To write code in Visual Basic Visual Basic Copy Code . zip. retrieve a stream with the image data (OpenReader method). and load the image (Image. C1ZipFile zip = new C1ZipFile().Create(s + @"\images. s. // Add to the zip file. // Add to the list. listBox1. // Populate the zip file and list.GetFileName(fname)). and add them all to a zip file. System. zip.FromStream method). s = s.

System. Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.OpenReader().Entries[item].Image = CType(Image. private void listBox1_SelectedIndexChanged(object sender. TIFF.SelectedItem. string item = (string)listBox1. try { pictureBox1. Stream s = zip. GIF.EventArgs) Handles ListBox1.' Show selected image. Dim item As String = CStr(listBox1.Image = (Image)Image. . including ICO.Close().FromStream(s).Entries(item).SelectedItem) ' Load the image directly from a compressed stream. s.SelectedIndexChanged ' Get the selected item.OpenReader() Try pictureBox1. Image) Catch End Try ' Done with stream.Close() End Sub To write code in C# C# Copy Code // Show selected image. and JPG images. } This topic illustrates the following: This example shows several types of images.Object.EventArgs e) { // Get the selected item. } catch {} // Done with stream.FromStream(s). // Load the image directly from a compressed stream. s. Dim s As Stream = zip. BMP. ByVal e As System.

Note that this method requires a little more work than the OpenWriter method. Add the code to the Button_Click event: To write code in Visual Basic Visual Basic Copy Code Private Sub Button1_Click(ByVal sender As System. but is still very manageable.  MemoryStream method Use a MemoryStream method. " + "Rough winds do shake the darling . use one of the following methods:  C1ZipEntryCollection. The data is compressed as you write it into the stream. write the data into it.Object. and then close it.Click Dim str As String = "Shall I compare thee to a summer's day? " + "Thou art more lovely and more temperate.EventArgs) Handles Button1. The following code shows both methods. ByVal e As System.Saving a String Variable to a Zip File To save a string variable to a zip file. and the whole stream is saved into the zip file when you close it.OpenWriter method Use the OpenWriter method to get a stream writer. and then add the stream to the zip file. write the string into it.

txt") stream. Dim stream As Stream = zipFile.Entries. sw.Flush() stream.Write(str). stream = new MemoryStream(). StreamWriter sw = new StreamWriter(stream). sw = new StreamWriter(stream).Close() End Sub To write code in C# C# Copy Code private void button1_Click(object sender.Create(@"c:\temp\strings.EventArgs e) { string str = "Shall I compare thee to a summer's day? " + "Thou art more lovely and more temperate." Dim zipFile As New C1ZipFile() zipFile.Write(str).Create("c:\temp\strings.Add(stream. // Method 1: OpenWriter.OpenWriter("Shakespeare. // Method 2: Memory Stream. True) Dim sw As New StreamWriter(stream) sw.Flush(). zipFile. " + "Rough winds do shake the darling buds of May. stream = New MemoryStream() sw = New StreamWriter(stream) sw. sw.Write(str) sw. " + "And summer's lease hath all too short a date.Position = 0 zipFile.OpenWriter("Shakespeare.Entries. C1ZipFile zipFile = new C1ZipFile().txt". System.Close() ' Method 2: Memory Stream.buds of May.". "Shakespeare2.Close().txt".zip").Entries.zip") ' Method 1: OpenWriter. true). " + "And summer's lease hath all too short a date. sw. . sw.Write(str) sw. Stream stream = zipFile.

CompressionLevelEnum. C1ZStreamWriter compressor = new C1ZStreamWriter(fs.stream.Add(stream.Position = 0. NoCompression has no compression. Note that the code sample above sets the compression level to BestCompression.Create) Dim compressor As New C1ZStreamWriter(fs. stream. FileStream fs = new FileStream(fn. FileMode. DefaultCompression has normal compression time and speed. "Shakespeare2. set the compression level on the C1ZStreamWriter's constructor by using the following code: To write code in Visual Basic Visual Basic Copy Code Dim fn As String = Path.Close().GetTempFileName() Dim fs As New FileStream(fn. CompressionLevelEnum.Create). For example: To write code in Visual Basic . Each entry may have its own password.Entries. FileMode. zipFile. } Setting the Level of Compression To minimize the file size of the compressed file. Other compression level options on the C1ZStreamWriter's constructor include the following:    BestSpeed has low compression time and the highest speed.txt").BestCompression) To write code in C# C# Copy Code string fn = Path. Using Passwords to Protect Zip Files To create password-protected zip files. set the Password property to a non-empty string before creating any entries. which has the highest compression time and the lowest speed.GetTempFileName().BestCompression).

Password = "".Entries.Extract(someFile).Add(someFile).Extract(someFile) ' Will succeed.Visual Basic Copy Code C1Zip.Entries.Extract(someFile) ' Will fail. C1Zip.Add(someFile) To write code in C# C# Copy Code C1Zip. C1Zip. the Password property must be set to the same value in effect when the entry was added.Extract(someFile). For example: To write code in Visual Basic Visual Basic Copy Code ' Will fail.Password = "password" C1Zip. C1Zip.Password = "password".Entries.Password = "pass" C1Zip.Password = "pass". password not set.Password = "" C1Zip.Entries.Extract(someFile) To write code in C# C# Copy Code // Will fail. wrong password. .Entries. wrong password. password not set.Password = "password" C1Zip. // Will fail. C1Zip. C1Zip. C1Zip.Entries.Entries. To extract this entry later. C1Zip. C1Zip.

By compressing the streams. Compressed Shows how you can combine Zip with . inspect.// Will succeed.NET Samples for additional examples that can be used as a reference.Entries. Files Using the zip format for your application storage needs has several advantages: it is an open-standard.NET Tutorials The following topics contain tutorials that illustrate some of the main features in the C1Zip library. you can reduce the memory requirements for your application. See Also Compressing Data in Memory Compressing Files Compressed Serialization Handling Zip Files . Tutorial Description Compressing Shows how you can compress and expand arbitrary data in memory. See the included Zip for . space-efficient format. Compressing Shows how you can compress individual files so they take up less disk space Files and are less exposed to access by users. describing each step in detail. The tutorials walk you through the creation of several simple projects.NET serialization to save objects into Serialization streams that are a fraction of the regular size. just individual compressed files. Handling Zip Shows how you can open. This Data in Memory technique is useful in any situation where you keep memory streams while the application is running. well-documented. If you are serializing objects into XML streams. The last tutorial covers zip files. Zip for .Password = "password". and remove files in a zip archive. C1Zip. add. the savings in disk space and network bandwidth can be huge. Note that these are not zip files.Extract(someFile). C1Zip.

add the following controls to the form.Enabled Property 1 Compress String btnCompressString True (Default) 2 Decompress String btnExpandString False 3 Compress Data btnCompressData True (Default) 4 Decompress Data btnExpandData False Note: The Decompress String and Decompress Data buttons cannot be used until we have some compressed data to expand. Here is what the final application will look like: Step 1: Create the main form. .Name Property Button. Start a new Visual Studio project. and expand the data back when you read it from the streams. as shown in the picture above. In the Properties window make the following changes to each Button control: Button Button.Compressing Data in Memory This tutorial shows how you can compress basic data types such as strings and doubles into memory streams.Text Property Button. From the Toolbox. by performing a drag-and-drop operation or by double-clicking the component:  Four Button controls along the left edge of the form.

Copy Code . using C1. or browse to find the C1.  A Label control below the text box. Go to the Solution Explorer window and click the Show All Files button. At the top of the file.2. Select the ellipsis button located next to Lines property.C1Zip To write code in C# C# using System.C1Zip assembly from the list.IO Imports C1. Select the C1.dll file.C1Zip. Select the Form1. Right-click on References.C1Zip.cs for C#) or go to View|Code to open the Code Editor. A TextBox on the upper-right of the form. Step 2: Add a reference to the C1Zip assembly.IO. Set the MultiLine property to True. add the following statements: To write code in Visual Basic Visual Basic Copy Code Imports System. In the String Collection Editor dialog box type text to use as an initial value. and select the Add Reference menu option.vb tab (Form1.

Click ' Compress the string.Length Dim msg As String msg = String. "Compressed".Ticks . long ticks = DateTime.Object. MessageBoxButtons. lenAfter. lenBefore. Dim ms As Integer ms = (DateTime.Ticks. EventArgs e) { // Compress the string.Show(msg. ms) MessageBox. btnExpandString.TicksPerMillisecond Dim lenBefore As Integer = textBox1. and add the following code to handle the btnCompressString_Click event: To write code in Visual Basic Visual Basic Copy Code Private m_CompressedString As Byte() Private Sub btnCompressString_Click(ByVal sender As System.Now.This makes the objects defined in the C1Zip assembly visible to the project and saves a lot of typing. Dim ticks As Long = DateTime.ticks) / TimeSpan.Text.".Information) ' We can now expand it.Format("Compressed from {0} bytes to " & "{1} bytes in {2} milliseconds. Step 3: Add code to compress strings.EventArgs) Handles btnCompressString. .Ticks m_CompressedString = CompressString(textBox1. private void btnCompressString_Click(object sender.OK. Double-click the Compress String command button.Now.Now. ByVal e As System. MessageBoxIcon.Enabled = True End Sub To write code in C# C# Copy Code private byte[] m_CompressedString.Text) ' Tell the user how long it took.Length * 2 Dim lenAfter As Integer = m_CompressedString.

Write(str) ' Flush any pending data. Dim sw As C1ZStreamWriter = New C1ZStreamWriter(ms) ' Write the data into the compressor stream. } The first main line declares a member variable called m_CompressedString which will be used to hold the compressed data (encoded as a byte array). lenAfter. lenBefore. This is because .m_CompressedString = CompressString(textBox1.Show(msg. MessageBoxButtons. Dim ms As MemoryStream = New MemoryStream() ' Attach a compressor stream to the memory stream.Information).ticks) / TimeSpan.Text. Dim writer As StreamWriter = New StreamWriter(sw) writer. (Note that the lenBefore variable is calculated as the length of the string times two. and each character actually takes up two bytes. The second main line calls a utility function CompressString that compresses a given string into a byte array that can later be expanded to restore the original string. writer.TicksPerMillisecond).Length * 2. // Tell the user how long it took. int lenBefore = textBox1.Text). MessageBoxIcon. // We can now expand it.Flush() ' Return the memory buffer. CompressString = ms.NET strings are Unicode. MessageBox. ms).Length. string msg = string .Format("Compressed from {0} bytes to " + "{1} bytes in {2} milliseconds. The remainder of the code is used to measure how long the compression process took and to show a dialog box with statistics. btnExpandString. "Compressed". int ms = (int)((DateTime.) Add the following code which implements the CompressString function: To write code in Visual Basic Visual Basic Copy Code Public Function CompressString(ByVal str As String) As Byte() ' Open the memory stream.Now.ToArray() End Function .Ticks .Enabled = true.OK.". int lenAfter = m_CompressedString.

The C1ZStreamWriter object only supplies the basic Stream methods for writing bytes and byte arrays. return ms. To be able to write other basic types such as strings. C1ZStreamWriter sw = new C1ZStreamWriter(ms).Write(str). } The function starts by creating a new memory stream.To write code in C# C# Copy Code public byte[] CompressString(string str) { // Open the memory stream. MemoryStream ms = new MemoryStream().Flush(). // Attach a compressor stream to the memory stream. the function creates a C1ZStreamWriter object and attaches it to the new memory stream. we attach a StreamWriter object to the C1ZStreamWriter. // Write the data into the compressor stream. integers. and so on.ToArray(). Here's a diagram that shows how this works: . writer. StreamWriter writer = new StreamWriter(sw). writer. This stream will automatically allocate a memory buffer to hold the compressed data. // Return the memory buffer. Any data written to the C1ZStreamWriter object will be compressed and written to the memory stream. Next. // Flush any pending data.

ms) MessageBox.TicksPerMillisecond Dim lenBefore As Integer = m_CompressedString.Click ' Expand the string.Ticks TextBox1.Length Dim lenAfter As Integer = TextBox1.Now. Dim ticks As Long = DateTime.Ticks .Information) End Sub To write code in C# C# Copy Code private void btnExpandString_Click(object sender. we need to follow the reverse sequence of steps used to compress.ticks) / TimeSpan.". the code uses the ToArray method to return the byte array that was created by the memory stream.OK. and add the following code to handle the btnExpandString_Click event: To write code in Visual Basic Visual Basic Copy Code Private Sub btnExpandString_Click(ByVal sender As System. MessageBoxButtons. When done writing. lenBefore.Format("Expanded from {0} bytes to {1} bytes " & "in {2} milliseconds. Finally.EventArgs) Handles btnExpandString. we also call the Flush method to make sure all cached input is written out. EventArgs e) { . "Expanded". To expand the string.Text = ExpandString(m_CompressedString) ' Tell the user how long it took. all we need to do is call its Write method to write the string into the compressed memory stream.Now.After the StreamWriter is set up. Dim ms As Integer = (DateTime. MessageBoxIcon.Object. Step 4: Add code to expand strings. Double-click the Decompress String button. ByVal e As System.Text. lenAfter.Show(msg.Length * 2 Dim msg As String msg = String.

TicksPerMillisecond).Now.ReadToEnd() End Function To write code in C# C# Copy Code public string ExpandString(byte[] buffer) { // Turn buffer into a memory stream. MessageBoxButtons. Dim ms As MemoryStream = New MemoryStream(buffer) ' Attach a decompressor stream to the memory stream.Text.Information). msg = string . lenBefore.Length * 2.Ticks.Length.Text = ExpandString(m_CompressedString).Ticks . Dim reader As StreamReader = New StreamReader(sr) ExpandString = reader. int ms = (int)((DateTime. MessageBoxIcon.". textBox1. lenAfter. // Tell the user how long it took. .OK. ms).Now. int lenBefore = m_CompressedString. Dim sr As C1ZStreamReader = New C1ZStreamReader(ms) ' Read uncompressed data. MessageBox.// Expand the string.Show(msg. string msg. long ticks = DateTime. int lenAfter = textBox1. } The main line calls the utility function ExpandString that takes a byte array and returns the original string.ticks) / TimeSpan. Add the following code for the ExpandString function: To write code in Visual Basic Visual Basic Copy Code Public Function ExpandString(ByVal buffer As Byte()) As String ' Turn buffer into a memory stream. "Expanded".Format("Expanded from {0} bytes to {1} bytes " + "in {2} milliseconds.

ByVal e As System. // Attach a decompressor stream to the memory stream.PI / 180. Dim i As Integer Dim count As Integer = 1000 bw.Write(Math. The only difference is that instead of attaching a StreamWriter object to the compressor stream. or paste new content into it. you can already experiment with string compression and decompression.0 bw. Dim ms As MemoryStream = New MemoryStream() ' Attach a compressor stream to the memory stream.Write(i) bw.ReadToEnd(). Compressing binary data is just as easy as compressing strings.Write(count) For i = 0 To count . C1ZStr // Read uncompressed data.Write(a) bw. Double-click the Compress Data button and add the following code to handle the btnCompressData_Click event: To write code in Visual Basic Visual Basic Copy Code Private m_CompressedData As Byte() Private Sub btnCompressData_Click(ByVal sender As System.MemoryStream ms = new MemoryStream(buffer).1 Dim a As Double = i * Math.Click ' Open the memory stream. you attach a BinaryWriter object. Dim sw As C1ZStreamWriter = New C1ZStreamWriter(ms) ' Attach a BinaryWriter to the compressor stream. Step 5: Add code to compress binary data.Object. } If you run the project now. Dim bw As BinaryWriter = New BinaryWriter(sw) ' Write a bunch of numbers into the stream. You can change the text in the text box.EventArgs) Handles btnCompressData.Sin(a)) . StreamReader reader = new StreamReader(sr). then compress and expand the string to see how much it compresses. return reader.

bw. bw. int i.PI / 180. EventArgs e) { // Open the memory stream. } // Flush any pending output. Dim msg As String msg =String. // Write a bunch of numbers into the stream.Write(i). C1ZStreamWriter sw = new C1ZStreamWriter(ms). // Attach a compressor stream to the memory stream. MemoryStream ms = new MemoryStream().Format("Generated table with {0} points.Enabled = True End Sub To write code in C# C# Copy Code private void btnCompressData_Click(object sender.Flush() ' Save the compressed data. bw. for (i = 0 . m_CompressedData = ms. int count = 1000. i <= count .Sin(a)). i++) { double a = i * Math. m_CompressedData.Write(Math.Text = msg ' We can now expand it.Cos(a)) Next i ' Flush any pending output. bw.ToArray() ' Done. // Attach a BinaryWriter to the compressor stream.bw. count.Write(a).Cos(a)).1.Write(count)." & " saved into {1} bytes".Write(Math.Length) Label1.Write(Math. bw. . btnExpandData. BinaryWriter bw = new BinaryWriter(sw). bw.0.

" + " saved into {1} bytes".EventArgs) Handles btnExpandData. string msg.ToArray().Format("Generated table with {0} points. Dim ms As MemoryStream = New MemoryStream(m_CompressedData) ' Attach a decompressor stream to the memory stream.Click ' Open the memory stream on saved data. msg =string .Text = msg. Expanding the compressed binary data is just a matter of setting up the decompressor stream and reading the data like you would read it from a regular stream. C1ZStreamWriter. } The code starts by declaring a member variable called m_CompressedData which will be used to hold the compressed data (encoded as a byte array).ReadInt32() For i = 0 To count . Then it sets up the MemoryStream.Length). the Flush method is used as before. // We can now expand it. the code writes data into the stream using the Write method. Dim i As Integer Dim br As BinaryReader = New BinaryReader(sr) Dim count As Integer = br. The BinaryWriter object overloads this method so you can write all basic object types into streams. // Done.bw.Enabled = true. m_CompressedData. Finally. ByVal e As System. and BinaryWriter objects as before (the only difference is we're now using a BinaryWriter instead of a StreamWriter). Add the following Click event handler code for the Decompress Data command button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnExpandData_Click(ByVal sender As System.1 . to make sure any cached data is written out to the compressed stream. Dim sr As C1ZStreamReader = New C1ZStreamReader(ms) ' Read the uncompressed data. Next. // Save the compressed data. m_CompressedData = ms. Step 6: Add code to expand the binary data. btnExpandData. label1. count.Object.Flush().

ReadInt32() Dim rad As Double = br. msg = string .1.ReadInt32().". double sin = br. i++) { int deg = br. m_CompressedData. C1ZStreamReader sr = new C1ZStreamReader(ms). MemoryStream ms = new MemoryStream(m_CompressedData).Text = msg.ReadDouble().". EventArgs e) { // Open the memory stream on saved data. BinaryReader br = new BinaryReader(sr). string msg. int i. count. double cos = br.ReadDouble() Dim sin As Double = br.Length).ReadDouble() Next i ' Done. Dim msg As String msg = String. count. i <= count . You can step through it in debug mode to make sure the data being read is the same that was written in. // Read the uncompressed data.Format("Read table with {0} points " + "from stream with {1} bytes. double rad = br. . } The code reads the data but does not display it.Length) Label1. tell the user about it. for (i = 0 .Dim deg As Integer = br.Text = msg End Sub To write code in C# C# Copy Code private void btnExpandData_Click(object sender.ReadDouble(). } // Done. label1.Format("Read table with {0} points " & "from stream with {1} bytes. int count = br. m_CompressedData.ReadInt32().ReadDouble() Dim cos As Double = br. // Attach a decompressor stream to the memory stream. tell the user about it.ReadDouble().

Here is what the final application will look like: Step 1: Create the main form. Select the Form1. you will see that the data is saved in an array with 14. Zip files are covered in the Handling Zip Files tutorial. Select the C1.2.dll file. they are just compressed streams on disk.125 bytes. To save this data in a regular stream. Note that these are not zip files.cs in C#) or go to View|Code to open the Code Editor.004 bytes.If you run the project and click the compress/decompress data buttons. add the following statements: . Right-click on References. Start a new Visual Studio project and from the Toolbox.vb tab (Form1. or browse to find the C1.C1Zip assembly from the list. A Label control on the right of the buttons.C1Zip. This control will display statistics about the compression/expanding process.Enabled Property 1 Compress Files btnCompress True (Default) 2 Expand Files btnExpand False Note that the Expand Files button cannot be used until we have some compressed files to expand. This concludes the Compressing Data in Memory tutorial.Text Property Button.Name Property Button. At the top of the file. it would take [4 + 1000 * (4 + 8 * 3)] = 28. In the Properties window make the following changes: Button Button. Compressing Files This tutorial shows how you can compress and expand individual files. add the following controls to the form:    Two Button controls along the left edge of the form. as shown in the picture above. So we compressed it to about half the original size. Step 2: Add a reference to the C1Zip assembly. Go to the Solution Explorer window and click the Show All Files button. and select the Add Reference menu option.

IO assemblies visible to the project and saves a lot of typing. In the Code Editor of the form. Step 4: Add code to compress files. using C1. define the following constants: To write code in Visual Basic Visual Basic Copy Code Private Const DIR_COMP = "\compressed" Private Const DIR_EXP = "\expanded" To write code in C# C# Copy Code private const string DIR_COMP = @"\compressed". These are the directory names where the compressed and expanded files will be stored (relative to the directory where the tutorial application is located on your disk). Step 3: Define the directory names for the compressed and expanded files.C1Zip.IO Imports C1. This makes the objects defined in the C1Zip and System.C1Zip To write code in C# C# Copy Code using System. private const string DIR_EXP = @"\expanded".IO.To write code in Visual Basic Visual Basic Copy Code Imports System. Add the following code to handle the Click event for the Compress Files command button: .

Text = msg . Dim appPath As String = Application. sizeCompressed.ticks) / TimeSpan.Exists(appPath + DIR_COMP)) Then Directory. (DateTime.Length Next srcFile ' Show stats.Now.To write code in Visual Basic Visual Basic Copy Code Private Sub btnCompress_Click(ByVal sender As System." & vbCrLf & "Original size: {2:#.CreateDirectory(appPath + DIR_COMP) ' Prepare to collect compression statistics. ByVal e As System.Ticks . count = count + 1 size = size + New FileInfo(srcFile).0) Label1.cmp" ' Compress file.###}" & vbCrLf & "Compressed size: {3:#.TicksPerMillisecond. srcFile) ' Update stats.Format("Compressed {0} files in {1} ms.Substring(0.GetFileName(srcFile) + ". True) End If Directory. If (Directory. count.Length sizeCompressed = sizeCompressed + New FileInfo(dstFile).Click ' Get the application directory. Dim count As Long Dim size As Long Dim sizeCompressed As Long Dim ticks As Long = DateTime.###} ({4:0.Ticks ' Compress all files in the application dir into the compressed dir. (sizeCompressed / size) * 100. i) ' Create a directory for compressed files.EventArgs) Handles btnCompress. Dim msg As String = String.GetFiles(appPath) Dim srcFile As String For Each srcFile In files Dim dstFile As String dstFile = appPath + DIR_COMP + "###BOT_TEXT###quot; + Path. size.Object.00}% of original)". Dim files As String() = Directory. CompressFile(dstFile.ExecutablePath Dim i As Integer = appPath.IndexOf("\bin###BOT_TEXT###quot;) If i > 0 Then appPath = appPath.Delete(appPath + DIR_COMP.Now.

GetFiles(appPath)) { string dstFile = appPath + DIR_COMP + @"###BOT_TEXT###quot; + Path.Length. // Update stats. } // Show stats.' Now we can expand.CreateDirectory(appPath + DIR_COMP). Directory. int i = appPath.Now.Length. count.TicksPerMillisecond.###} ({4:0.cmp".Exists(appPath + DIR_COMP))) Directory. long count = 0.ticks) / TimeSpan. size += new FileInfo(srcFile). (DateTime. size.###}\n\r" + "Compressed size: {3:#. sizeCompressed += new FileInfo(dstFile). true). // Compress all files in the application dir into the compressed dir.Delete(appPath + DIR_COMP.Enabled = True End Sub To write code in C# C# Copy Code private void btnCompress_Click(object sender. srcFile). string appPath = Application.IndexOf(@"\bin###BOT_TEXT###quot;). foreach (string srcFile in Directory.ExecutablePath.Format("Compressed {0} files in {1} ms. .00}% of original)". if (i > 0) appPath = appPath. count++.Ticks .\n\r" + "Original size: {2:#. if ((Directory. long size = 0. // Prepare to collect compression statistics. i).Ticks. (sizeCompressed / size) * 100. long ticks = DateTime.Now. CompressFile(dstFile. btnExpand. EventArgs e) { // Get the application directory. sizeCompressed. long sizeCompressed = 0. string msg = string . // Create a directory for compressed files.0).Substring(0.GetFileName(srcFile) + ". // Compress file.

Close() If Not (dstStream Is Nothing) Then dstStream.Write) ' Open a compressor stream on the destination file.Enabled = true.Text = msg. } The main line calls the utility function CompressFile utility method to compress each selected file.Read) dstStream = New FileStream(dstFile. srcStream) Catch ' Exception? Tell the caller we failed.Close() End Try ' Done. StreamCopy(sw.Open. FileMode. srcStream = New FileStream(srcFile. // Now we can expand. The compressed files are stored in the \compressed directory under the application folder. btnExpand. FileMode. Add the following code for the CompressFile function: To write code in Visual Basic Visual Basic Copy Code Private Function CompressFile( dstFile As String. Dim retval As Boolean = True Dim srcStream As FileStream = Nothing Dim dstStream As FileStream = Nothing Try ' Open the files. srcFile As String) As Boolean ' Prepare to compress file. FileAccess. They have the same name as the original file. FileAccess. retval = False Finally ' Always close our streams. plus a CMP extension.label1. Dim sw As C1ZStreamWriter = New C1ZStreamWriter(dstStream) ' Copy the source into the compressor stream.Create. If Not (srcStream Is Nothing) Then srcStream. CompressFile = False End Function To write code in C# .

Close(). if (srcStream != null) srcStream.Close(). it calls the StreamCopy function to transfer data from the source file and write it into the compressor stream. StreamCopy(sw.Open. FileMode. string srcFile) { // Prepare to compress file. dstStream = new FileStream(dstFile. FileStream srcStream = null. return false. try { // Open the files. Then it creates a C1ZStreamWriter object and attaches it to the destination stream.C# Copy Code private bool CompressFile(string dstFile.Read). } The function starts by creating two new file streams: one for the source file and one for the compressed file. } finally { // Always close our streams. Next. // Copy the source into the compressor stream. FileAccess. srcStream = new FileStream(srcFile. FileAccess. retval = false. srcStream). FileStream dstStream = null. Note the use of the Finally statement to ensure that both streams are properly closed even if there are exceptions while the function is executing. } // Done.Write). if (dstStream != null) dstStream. bool retval = true. } catch { // Exception? Tell the caller we failed. C1ZStreamWriter sw = new C1ZStreamWriter(dstStream). Here's the code: . // Open a compressor stream on the destination file. FileMode. The StreamCopy function simply copies bytes from one stream to another. Finally. the function closes both streams.Create.

Flush().Read(buffer. Step 5: Add code to expand files.Length).Write(buffer. dstStream. Stream srcStream) { byte[] buffer= new byte[32768]. if (read == 0) break. } Note that the function calls the Flush method after it is done to ensure that any cached data is written out when the function is done copying.Read(buffer. } dstStream. buffer. 0. srcStream As Stream) Dim buffer(32768) As Byte Dim read As Integer Do read = srcStream. since they cache substantial amounts of data in order to achieve good compression rates.) { int read = srcStream. read). 0.. for (. Add the following code to handle the Click event for the Expand Files command button: To write code in Visual Basic Visual Basic Copy Code .Length) dstStream. This is especially important when dealing with compressed streams.To write code in Visual Basic Visual Basic Copy Code Private Sub StreamCopy(dstStream As Stream. read) Loop While read > 0 dstStream. 0.Flush() End Sub To write code in C# C# Copy Code private void StreamCopy(Stream dstStream. 0. buffer.Write(buffer.

00} x size of compressed)".Length sizeExpanded = sizeExpanded + New FileInfo(dstFile). count.ticks) / TimeSpan. Dim dstFile As String = appPath + DIR_EXP + "###BOT_TEXT###quot; + Path.Delete(appPath + DIR_EXP. Dim srcFile As String Dim files As String() files = Directory. e As EventArgs) Handles btnExpand.Click ' Get the application directory.Replace(".Now.Text = msg End Sub To write code in C# .TicksPerMillisecond.GetFileName(srcFile) dstFile = dstFile. size.CreateDirectory(appPath + DIR_EXP) ' Prepare to collect compression statistics.Substring(0.Now.ExecutablePath Dim i As Integer = appPath.Length Next srcFile ' Show stats. True) End If Directory. "") ExpandFile(dstFile.###}" & vbCrLf & "Expanded size: {3:#. Dim appPath As String = Application.cmp".IndexOf("\bin###BOT_TEXT###quot;) If i > 0 Then appPath = appPath. srcFile) ' Update stats.Ticks ' Expand all files in the "compressed" dir to the "expanded" dir.GetFiles(appPath + DIR_COMP) For Each srcFile In files ' Expand file. i) ' Create a directory for expanded files. sizeExpanded / size) Label1.Private Sub btnExpand_Click(sender As Object.Format("Expanded {0} files in {1} ms.Ticks .###} ({4:0." & vbCrLf & "Original size: {2:#. sizeExpanded. If Directory. Dim count As Long Dim size As Long Dim sizeExpanded As Long Dim ticks As Long = DateTime.Exists(appPath + DIR_EXP) Then Directory. Dim msg As String msg = String. (DateTime. count = count + 1 size = size + New FileInfo(srcFile).

00} x size of compressed)". i).Replace(". long count = 0. } The main line calls the utility function ExpandFile utility method to expand the files that were compressed earlier.IndexOf(@"\bin###BOT_TEXT###quot;). label1. count.\r\n" + "Original size: {2:#.CreateDirectory(appPath + DIR_EXP).Text = msg.Substring(0. sizeExpanded. string msg = string . They have the same name as the original file.GetFileName(srcFile).###} ({4:0. string dstFile = appPath + DIR_EXP + @"###BOT_TEXT###quot; + Path.ExecutablePath. // Expand all files in the "compressed" dir to the "expanded" dir. if (Directory. count++.Ticks. true).Length.Now.###}\r\n" + "Expanded size: {3:#. "").cmp".C# Copy Code private void btnExpand_Click(object sender. // Create a directory for expanded files. Here's the code for the ExpandFile function: . srcFile). dstFile = dstFile.TicksPerMillisecond.Format("Expanded {0} files in {1} ms. (DateTime. foreach (string srcFile in Directory. long ticks = DateTime. // Update stats.Delete(appPath + DIR_EXP.Exists(appPath + DIR_EXP)) Directory. sizeExpanded / size). sizeExpanded += new FileInfo(dstFile). size. The expanded files are stored in the \expanded directory under the application folder.ticks) / TimeSpan.Length. minus the CMP extension.GetFiles(appPath + DIR_COMP)) { // Expand file.Now.Ticks . size += new FileInfo(srcFile). long size = 0. ExpandFile(dstFile. if (i > 0) appPath = appPath. EventArgs e) { // Get the application directory. int i = appPath. } // Show stats. // Prepare to collect compression statistics. long sizeExpanded = 0. Directory. string appPath = Application.

To write code in Visual Basic Visual Basic Copy Code Private Function ExpandFile(dstFile As String. sr) Catch ' Exception? Tell the caller we failed. srcStream = New FileStream(srcFile. string srcFile) { // Prepare to expand file. srcFile As String) As Boolean ' Prepare to expand file.Close() End Try ' Done.Close() If Not (dstStream Is Nothing) Then dstStream.Write) ' Open an expander stream on the compressed source.Create. StreamCopy(dstStream.Open. FileStream srcStream = null. FileStream dstStream = null. bool retval = true. FileAccess. FileMode. . If Not (srcStream Is Nothing) Then srcStream. Dim sr As C1ZstreamReader = New C1ZStreamReader(srcStream) ' Copy the expander stream into the destination file. retval = False Finally ' Always close our streams. Dim retval As Boolean = True Dim srcStream As FileStream = Nothing Dim dstStream As FileStream = Nothing Try ' Open the files. FileAccess.Read) dstStream = New FileStream(dstFile. FileMode. ExpandFile = retval End Sub To write code in C# C# Copy Code private bool ExpandFile(string dstFile.

srcStream = new FileStream(srcFile. This concludes the Compressing Files tutorial. if (srcStream != null) srcStream. } catch { // Exception? Tell the caller we failed. sr). Compressed Serialization This tutorial shows how you can serialize objects in compressed files. The table is saved (serialized) into regular and compressed streams. retval = false. FileMode. } The function is similar to CompressFile.Create.Read). C1ZStreamReader sr = new C1ZStreamReader(srcStream). StreamCopy(dstStream. Here is what the final application will look like: . except it attaches a C1ZStreamReader to the source stream instead of attaching a C1ZStreamWriter to the destination stream. FileAccess. the data is loaded back from either stream. FileAccess. The sample creates a data table using the NorthWind database. return retval.Write). } finally { // Always close our streams.Close(). // Open an expander stream on the compressed source.try { // Open the files. } // Done. dstStream = new FileStream(dstFile. and then load them back into the memory. FileMode.Open. Finally.Close(). if (dstStream != null) dstStream. // Copy the expander stream into the destination file.

Then click the Add ToolStripStatusLabel drop-down arrow and select StatusLabel. In the Properties window make the following changes to each Button control: Button Button. Start a new Visual Studio project and from the Toolbox. as shown in the picture above.Name Property Button. A ToolStripStatusLabel control appears and is docked at the bottom of the form. A ToolStripStatusLabel control docked at the bottom of the form. first add a StatusStrip control to the form. Step 2: Add references and Imports statements. .Step 1: Create the main form. To add this control. A DataGridView control on the right of the form.Enabled Property 1 Create Data Table btnCreate True (Default) 2 Save Data Table btnSave False 3 Load Data Table btnLoad False 4 Load Compressed Data Table btnLoadCompressed False Note that the save and load buttons cannot be used until the data table has been created or saved. add the following controls to the form:     Four Button controls along the left edge of the form.Text Property Button.

This declares the namespaces of the classes used in the project.C1Zip.Data.compressed" Private Const MDBFILE = " C:\Users\Documents\ComponentOne Samples\common\C1NWIND.dll file.Binary. add the following statements: To write code in Visual Basic Visual Basic Copy Code Imports System. or browse to find the C1.2.C1Zip. using System.Serialization.Binary Imports C1.Formatters.OleDb.OleDb Imports System.cs in C#) or go to View|Code to open the Code Editor. Select the Form1.C1Zip To write code in C# C# Copy Code using System.IO. using System. using C1. Select the C1.C1Zip assembly from the list.Go to the Solution Explorer window and click the Show All Files button.Formatters.MDB" To write code in C# .Runtime.Serialization. and select the Add Reference menu option. type or copy the following lines in the body of the form implementation: To write code in Visual Basic Visual Basic Copy Code Private Const FN_REGULAR = "\DataTable.Runtime.regular" Private Const FN_COMPRESSED = "\DataTable.Data. At the top of the file. Step 3: Declare constants.vb tab (Form1. In the Code Editor of the form. Right-click on References.IO Imports System.

OLEDB." ' Bind to the grid. Add the following code to handle the Click event for the Create Data Table button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnCreate_Click(sender As Object. Dim conn As String conn = "Provider=Microsoft.Show("Could not load data from " + MDBFILE) End Try ' Show status.Rows..4.Tables(0) .MDB"." Dim rs As String = "select * from customers" ' Show status. private const string MDBFILE = @"C C:\Users\Documents\ComponentOne Samples\common\C1NWIND. Dim da As OleDbDataAdapter = New OleDbDataAdapter(rs. Cursor = Cursors. These constants define the name of the database used to populate the data table and the file names used to serialize the data. Step 4: Add code to create the data table.DataSource = ds.Data Source=" & MDBFILE & ".Click ' Open the table.0.C# Copy Code private const string FN_REGULAR = @"\DataTable." ' Load data. DataGridView1.e As EventArgs) Handles btnCreate. private const string FN_COMPRESSED = @"\DataTable.Text = "Loading data from mdb file.Default ToolStripStatusLabel1. Cursor = Cursors.compressed".Count & " records from mdb file.Fill(ds) Catch MessageBox.Text = "Loaded " & ds.WaitCursor ToolStripStatusLabel1.Jet.Tables(0).regular".. conn) Dim ds As DataSet = New DataSet() Try da.

.Text = "Loaded " + ds. Cursor = Cursors..OLEDB. // Show status.Rows. } // Show status. DataSet ds = new DataSet(). OleDbDataAdapter da = new OleDbDataAdapter(rs.Enabled = true. Step 5: Add code to save the data table. which is then bound to the DataGrid control. btnSave.". toolStripStatusLabel1.' Enable the save button. // Bind to the grid.Tables[0]. } The function uses standard ADO.. try { da.EventArgs e) { // Open the table. toolStripStatusLabel1.4. string rs = "select * from customers". } catch { MessageBox. dataGridView1. // Load data.Data Source=" + MDBFILE + ". Cursor = Cursors.0.Jet. btnSave.Text = "Loading data from mdb file. string conn = "Provider=Microsoft.".Tables[0].NET objects and methods to create and populate a DataTable object.WaitCursor.Count + " records from mdb file.Show("Could not load data from " + MDBFILE). conn).Fill(ds).Enabled = True End Sub To write code in C# C# Copy Code private void btnCreate_Click(object sender.DataSource = ds.". // Enable the save button.Default.

.Length fs. dt) Dim lenRegular As Long = fs.Create) Dim bf As BinaryFormatter = New BinaryFormatter() bf.Create) Dim compressor As C1ZStreamWriter = New C1ZStreamWriter(fs) bf = New BinaryFormatter() bf. lenRegular. Cursor = Cursors..StartupPath & FN_COMPRESSED fs = New FileStream(fn.###} bytes)".Enabled = True btnLoadCompressed.Text = "Serializing data to compressed file. dt) Dim lenCompressed As Long = fs.Text = "Serializing data to regular file.Enabled = True End Sub To write code in C# .WaitCursor ToolStripStatusLabel1.Serialize(fs. FileMode." ' Serialize the data set to a compressed file. btnLoad. Dim fn As String = Application.Length fs. fn = Application.Close() ' Show status. Dim dt As DataTable = DataGridView1.Close() ' Show status.Click ' Get the data table from the grid.DataSource ' Show status.. e As EventArgs) Handles btnSave.Default ToolStripStatusLabel1.Format( "Saved to regular file ({0:#.###} bytes) and " & "compressed file ({1:#.WaitCursor ToolStripStatusLabel1. lenCompressed) ' Enable the load buttons. Cursor = Cursors.Text = string." ' Serialize the data set to a regular file.Serialize(compressor. FileMode. Cursor = Cursors.Add the following code to handle the Click event for the Save Data Table button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnSave_Click(sender As Object.StartupPath + FN_REGULAR Dim fs As FileStream = New FileStream(fn..

Length.WaitCursor. fn = Application. .###} bytes) and " + "compressed file ({1:#. long lenRegular = fs.. toolStripStatusLabel1. btnLoad. bf = new BinaryFormatter().Serialize(fs. string fn = Application. lenCompressed)..".StartupPath + FN_COMPRESSED. dt). // Serialize the data set to a compressed file. } The first set of code serializes the DataTable into a regular file. fs.. // Serialize the data set to a regular file. Cursor = Cursors. fs. // Enable the load buttons. bf. FileMode. // Show status. EventArgs e) { // Get the data table from the grid.Serialize(compressor. and the second serializes the DataTable into a compressed file. // Show status.Enabled = true.Text = string. lenRegular.Text = "Serializing data to compressed file.DataSource.StartupPath + FN_REGULAR.WaitCursor.###} bytes)". C1ZStreamWriter compressor = new C1ZStreamWriter(fs).".Create). dt). Note that only one additional line is required to compress the data. FileMode. fs = new FileStream(fn.Length. DataTable dt = (DataTable)dataGridView1. Cursor = Cursors. BinaryFormatter bf = new BinaryFormatter(). Cursor = Cursors.Default. toolStripStatusLabel1.Close(). toolStripStatusLabel1.Close()..Enabled = true.Text = "Serializing data to regular file.C# Copy Code private void btnSave_Click(object sender. btnLoadCompressed.Create). bf. FileStream fs = new FileStream(fn. // Show status.Format("Saved to regular file ({0:#. long lenCompressed = fs.

Dim fn As String = Application.Open) Dim ticks As Long = DateTime." ' Deserialize from regular file.WaitCursor DataGridView1.Deserialize(fs) Dim ms As Long = (DateTime. Cursor = Cursors.Ticks ." End Sub To write code in C# C# Copy Code private void btnLoad_Click(object sender.Now.TicksPerMillisecond fs.Default DataGridView1.Close() ' Show result. Cursor = Cursors.DataSource = Nothing ToolStripStatusLabel1.ToString() & " ms.Now.. a C1ZStreamWriter is used instead. e As EventArgs) Handles btnLoad.Text = "Loaded from regular file in " & ms.Text = "Loading from regular file.In both cases.Ticks Dim bf As BinaryFormatter = New BinaryFormatter() Dim dt As DataTable = bf. the serialization is executed by the BinaryFormatter object. Step 6: Add code to load the data table from the regular file. the Serialize method is called with a regular file stream as a parameter.StartupPath & FN_REGULAR Dim fs As FileStream = New FileStream(fn. The only difference is that in the first case. Add the following code to handle the Click event for the Load Data Table button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnLoad_Click(sender As Object.DataSource = dt ToolStripStatusLabel1. show status. FileMode.. . EventArgs e) { // Clear grid.Click ' Clear grid. in the second. show status.ticks) / TimeSpan.

DataSource = dt.StartupPath + FN_COMPRESSED Dim fs As FileStream = New FileStream(fn.Text = "Loaded from regular file in " + ms.". string fn = Application.Now. dataGridView1.ToString() + " ms.Text = "Loading from compressed file.Ticks . In this case. FileMode. FileMode.Deserialize(fs).Click ' Clear grid. dataGridView1.Close().TicksPerMillisecond.Now.Cursor = Cursors. Dim fn As String = Application.Default. FileStream fs = new FileStream(fn.." ' Deserialize from compressed file. Add the following code to handle the Click event for the Load Compressed Data Table button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnLoadCompressed_Click(sender As Object.Open) Dim ticks As Long = DateTime. the stream is a regular file stream... fs. e As EventArgs) Handles btnLoadCompressed.Text = "Loading from regular file. toolStripStatusLabel1.Ticks. show status. The Deserialize method takes a single parameter: the stream in which the object is defined. Cursor = Cursors. } The first main line of code creates a new BinaryFormatter object and the second one calls its Deserialize method. Step 7: Add code to load the data table from the compressed file.. // Show result. long ms = (DateTime. BinaryFormatter bf = new BinaryFormatter().DataSource = null.WaitCursor DataGridView1.DataSource = Nothing ToolStripStatusLabel1.Ticks Dim decompressor As C1ZstreamReader decompressor = New C1ZStreamReader(fs) Dim bf As BinaryFormatter = New BinaryFormatter() . long ticks = DateTime.Open).StartupPath + FN_REGULAR. Cursor = Cursors.WaitCursor.ticks) / TimeSpan. toolStripStatusLabel1.". // Deserialize from regular file.Now. DataTable dt = (DataTable)bf.

Default DataGridView1. EventArgs e) { // Clear grid. toolStripStatusLabel1.DataSource = dt." End Sub To write code in C# C# Copy Code private void btnLoadCompressed_Click(object sender. FileMode.TicksPerMillisecond. dataGridView1. toolStripStatusLabel1.ToString() + " ms. This concludes the Compressed Serialization tutorial. long ticks = DateTime.Deserialize(decompressor) Dim ms As Long = (DateTime.Now. fs..Text = "Loaded from compressed file in " + ms.ticks) / TimeSpan.Now. Cursor = Cursors.Dim dt As DataTable = bf.ToString() & " ms. show status.ticks) / TimeSpan. } The main lines are similar to the code used to deserialize data from a regular file. // Deserialize from compressed file. The only difference is that instead of passing a regular file stream to the Deserialize method.Text = "Loaded from compressed file in " & ms.Close().TicksPerMillisecond fs.Close() ' Show result.Open).StartupPath + FN_COMPRESSED. FileStream fs = new FileStream(fn. string fn = Application.". Cursor = Cursors. // Show result. C1ZStreamReader decompressor.Ticks ..Text = "Loading from compressed file.WaitCursor.Ticks.DataSource = dt ToolStripStatusLabel1.Ticks . BinaryFormatter bf = new BinaryFormatter().".Deserialize(decompressor). decompressor = new C1ZStreamReader(fs). dataGridView1.Default.DataSource = null. . long ms = (DateTime. we now use a C1ZStreamReader object. DataTable dt = (DataTable)bf. Cursor = Cursors.Now.

Opening an existing zip file. Here is what the final application will look like: Note: This is a very simple application. Extracting entries from the zip file. Step 1: Create the main form. Adding entries to the zip file. From the Toolbox. as shown in the picture above. zipping folders. which supports more advanced features such as drag and drop. Start a new Visual Studio project. add the following controls to the form: o Seven Button controls along the left edge of the form. setting the compression level. Testing the integrity of a zip file.Handling Zip Files This tutorial shows how you can handle zip files. The distribution disk also includes a more sophisticated version. 1. Expanding entries into memory streams. including the following operations:        Creating a zip file. and so on. designed to highlight the main functionality of the C1ZipFile object. Removing entries from the zip file. In the Properties window make the following changes to each Button control: .

and then set the Text property of each column to File. and Amount. click on the ellipsis button next to the Columns property. Size. The ColumnHeader Collection Editor dialog box appears.Text Property Button. To access the ListView Tasks menu. Click the Add button to add five ColumnHeaders. In the Properties window. click the smart tag ( ) in the upper right corner of the ListView control. Note: The Column Header Collection Editor can also be accessed by clicking Edit Columns in the ListView Tasks menu. respectively. Date.Name Property 1 Create Zip File… btnNew 2 Open Zip File… btnOpen 3 Add Files… btnAdd 4 Extract Files btnExtract 5 Remove Files btnRemove 6 View File btnView 7 Test Zip File btnTest A ListView control covering the right part of the form. 2. Compressed.o Button Button. Here is what the ColumnHeader Collection Editor should look like: .

Select the C1. Step 2: Add a reference to the C1Zip assembly. right-click on References. in the Properties window set the View property to Details or in the ListView Tasks menu. Select the Form1. select Details from the View drop-down box.C1Zip.vb tab (Form1.cs in C#) or go to View|Code to open the Code Editor.3. At the top of the file.C1Zip assembly from the list. add the following directives: . Select OK to close the editor box.2. Note that to view the column headers. Go to the Solution Explorer window.dll file. and select the Add Reference menu option. or browse to find the C1.

To write code in Visual Basic Visual Basic Copy Code Imports System. It implements the methods used to handle zip files. Step 3: Declare a C1ZipFile object.IO Imports C1. This is the main object in this application.IO. Add the following code to the Form_Load event: To write code in Visual Basic Visual Basic Copy Code . using C1. Step 4: Add code to initialize the C1ZipFile object. This makes the objects defined in the C1Zip and System.C1Zip.C1Zip To write code in C# C# Copy Code using System. Switch to the Code Editor and type (or copy) the following data member declaration: To write code in Visual Basic Visual Basic Copy Code Private m_Zip As C1ZipFile To write code in C# C# Copy Code private m_Zip As C1ZipFile.IO assemblies visible to the project.

". } This code creates a new C1ZipFile object and assigns it to the m_Zip member.Create(fo.OK Then Exit Sub End If ' Open zip file. Add the following code to handle the Click event for the Create Zip File command button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnNew_Click(ByVal sender As System. m_Zip = new C1ZipFile(). Dim fo As SaveFileDialog = New SaveFileDialog() fo.FileName = "*. Note that the C1ZipFile object cannot be used yet.DialogResult.Show("Can't create ZIP file. EventArgs e) { // Create the C1ZipFile member. e As EventArgs) Handles MyBase. please try again.Load ' Create the C1ZipFile member. m_Zip = New C1ZipFile() End Sub To write code in C# C# Copy Code private void Form1_Load(object sender.zip" If fo. It needs to be attached to an existing zip file first using the Open method (or to a new one using the Create method).ShowDialog() <> Windows. Step 5: Add code to create a zip file.Object.Forms.FileName) Catch MessageBox. ByVal e As System.EventArgs) Handles btnNew.Private Sub Form1_Load(sender As Object.Click ' Show open file dialog. Try m_Zip. "C1Zip") End Try .

Dim fo As OpenFileDialog = New OpenFileDialog() fo.FileName = "*.Click ' Show open file dialog. // Open zip file. EventArgs e) { // Show open file dialog.zip". SaveFileDialog fo = new SaveFileDialog().DialogResult.Forms. } Step 6: Add code to open a zip file. try { m_Zip. Add the following code to handle the Click event for the Open Zip File command button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnOpen_Click(sender As Object. UpdateDisplay() End Sub To write code in C# C# Copy Code private void btnNew_Click(object sender.ShowDialog() != DialogResult. fo. e As EventArgs) Handles btnOpen. } catch { MessageBox. "C1Zip").zip" If fo. if (fo.' Update display.ShowDialog() <> Windows.OK Then Exit Sub . UpdateDisplay().FileName = "*. please try again. } // Update display.Create(fo.OK ) return.FileName).Show("Can't create ZIP file.".

OK ) return. if (fo. fo. the code calls the UpdateDisplay utility function to display the contents of the zip file. add the UpdateDisplay utility function to display the contents of the zip file: To write code in Visual Basic . UpdateDisplay() End Sub To write code in C# C# Copy Code private void btnOpen_Click(object sender.Try m_Zip.Open(fo. } // Update display. Next.") End Try ' Update display. please try again. please try again. UpdateDisplay().FileName) Catch MessageBox. Step 7: Add code to update the display. Note the use of a Try/Catch statement.Show("Invalid ZIP file. } catch { MessageBox. mainly to handle situations where the use selects a file that is not a zip file."). } The main line calls the Open method on the C1ZipFile object to attach the object to an existing zip file.ShowDialog() != DialogResult.zip".Open(fo. OpenFileDialog fo = new OpenFileDialog(). After opening the file.Show("Invalid ZIP file.FileName = "*. try { m_Zip.FileName). EventArgs e) { // Show open file dialog.

Dim ze As C1ZipEntry For Each ze In m_Zip.Items.Enabled = hasEntries btnRemove.Items.SizeUncompressed > 0 Then pct = 1 .SizeUncompressed.ze. With ListView1 ' Remove any existing items. Dim pct As Double = 0 If ze.Enabled = hasEntries btnTest.##0") items(3) = Format(ze.Add(lvi) Next ze ' Update UI. Dim hasEntries As Boolean = (. "MM/dd/yy") items(2) = Format(ze. "00 %") Dim lvi As ListViewItem = New ListViewItem(items) ' Save ZipEntry into item tag. "#. "#.Entries ' Calculate the compression amount.SizeCompressed / ze. . .Enabled = hasEntries End With End Sub To write code in C# C# Copy Code .SizeCompressed.Items.##0") items(4) = Format(pct.Clear() ' Add each entry. lvi. Dim items(4) As String items(0) = ze.Tag = ze ' Add item to ListView.Date.Visual Basic Copy Code Private Sub UpdateDisplay() ' Update the ListView control to show the zip file contents.FileName items(1) = Format(ze.Count > 0) btnExtract.SizeUncompressed End If ' Build ListView item.

Entries) { // Calculate the compression amount.##0").Tag = ze. } // Build ListView item.Format(ze.##0").Strings. Note that the C1ZipEntry object itself is also saved in the Tag property of the ListView items.Strings. Microsoft. double pct = 0.private void UpdateDisplay() { // Remove any existing items.VisualBasic. } The main lines start by declaring a C1ZipEntry object and using it in a ForEach loop over the entries in the zip file (m_Zip.SizeUncompressed.Items.Date.SizeUncompressed > 0) { pct = 1 . // Save ZipEntry into item tag.Format(ze.Clear().VisualBasic. btnRemove. btnExtract. Finally. foreach (C1ZipEntry ze in m_Zip. } // Update UI. "00 %") }).VisualBasic. "MM/dd/yy").SizeCompressed.FileName. Microsoft. the code enables or disables the command buttons depending on whether or not there are entries available to be extracted. For each entry.Items.VisualBasic. Add the following code to handle the Click event for the Test Zip File command button: .(((double)ze. lvi. listView1. Microsoft.Items. the function creates a ListViewItem containing the information extracted from the C1ZipEntry object and adds the new entry to the ListView control.Format(pct. listView1. // Add each entry.Add(lvi).Count > 0). // Add item to ListView. if (ze. Microsoft.Enabled = hasEntries.Enabled = hasEntries. removed or tested. Step 8: Add code to test the integrity the zip file. bool hasEntries = (listView1. ListViewItem lvi = new ListViewItem(new string[] { ze. "#.Strings.Format(ze.SizeUncompressed)). "#. btnTest.Entries).SizeCompressed) / ((double)ze.Enabled = hasEntries.Strings.

} } // If we got here.FileName & " has errors.OK.Click ' Test each entry. The routine then calls the CheckCRC32 method on each entry to check whether the actual checksum of the bytes stored in the file matches the checksum stored in the entry header.To write code in Visual Basic Visual Basic Copy Code Private Sub btnTest_Click(sender As Object. everything is OK.Show("** Entry " + ze. MessageBox.Error) Exit Sub End If Next ' If we got here. EventArgs e) { // Test each entry. "C1Zip") End Sub To write code in C# C# Copy Code private void btnTest_Click(object sender.OK. "C1Zip".Entries) { if (!ze. } The main lines declare a C1ZipEntry variable and use it to loop over the entries in the zip file.Error). everything is OK. "C1Zip". Dim ze As C1ZipEntry For Each ze In m_Zip. MessageBoxIcon. foreach (C1ZipEntry ze in m_Zip.Entries If Not ze.Show("** Entry " & ze. MessageBoxIcon. MessageBoxButtons. "C1Zip").CheckCRC32()) { MessageBox. MessageBox.FileName + " has errors.Show("All entries passed CRC check".CheckCRC32() Then MessageBox.". return. MessageBoxButtons. e As EventArgs) Handles btnTest.".Show("All entries passed CRC check". The .

". Step 9: Add code to view the contents of an entry. 16000) End If ' Show the entry in the message box.Substring(0. no files to show. ze. Dim ze As C1ZipEntry = Nothing Dim lvi As ListViewItem For Each lvi In ListView1.Click ' Get the first selected item that is not a directory...ReadToEnd() entry. MessageBox.Length > 16000 Then entryText = entryText. e As EventArgs) Handles btnView.Show("Sorry.Close() ' Make sure the entry is not too big for the MessageBox.function returns true if the values match and false if they don't (which indicates the entry is corrupted).FileName) End Sub To write code in C# . If ze Is Nothing Then MessageBox. Add the following code to handle the Click event for the View File command button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnView_Click(sender As Object.Show(entryText. Dim entry As Stream = ze. "C1Zip") Exit Sub End If ' Read entry content into a string.SelectedItems Dim zeItem As C1ZipEntry = lvi. If entryText.Attributes And FileAttributes.Tag If (zeItem.OpenReader() Dim sr As StreamReader = New StreamReader(entry) Dim entryText As String = sr.Directory) = 0 Then ze = zeItem Exit For End If Next lvi ' Make sure we got something.

Length > 16000 ) { entryText = entryText. break..Directory == 0)) { ze = zeItem. } The function starts by choosing the first selected zip entry that is not a subdirectory. the data is expanded as it is read from the stream. entry. the function exits. no files to show.C# Copy Code private void btnView_Click(object sender. MessageBox. StreamReader sr = new StreamReader(entry). Stream entry = ze.Show(entryText.Show("Sorry.FileName). The function then calls the OpenReader method to obtain a Stream that can be used to read the contents of the entry.Attributes == 0) && (FileAttributes. return. If a valid entry cannot be found. EventArgs e) { // Get the first selected item that is not a directory.ReadToEnd(). } } // Make sure we got something. C1ZipEntry ze = null.Substring(0. } // Read entry content into a string. "C1Zip"). } // Show the entry in the message box.Tag as C1ZipEntry. 16000). ze. foreach (ListViewItem lvi in listView1. if (entryText. if (ze == null ) { MessageBox. // Make sure the entry is not too big for the MessageBox.. There are no temporary files or additional delays involved in this step.SelectedItems) { C1ZipEntry zeItem = lvi. string entryText = sr.Close(). if ((zeItem. .".OpenReader().

UpdateDisplay() End Sub To write code in C# C# Copy Code private void btnAdd_Click(object sender. it will show only a couple of characters.*" If fo.Click ' Get list of files to add. Dim fo As OpenFileDialog = New OpenFileDialog() fo.Entries. fo.Forms. then closes the stream. Dim file As String For Each file In fo. the string is truncated and displayed in a message box.Multiselect = true.FileName = "*. If you try to view the contents of binary files.FileName = "*.*".OK Then Exit Sub ' Add files in the list. OpenFileDialog fo = new OpenFileDialog(). fo. the function reads the entry content directly into a string using the ReadToEnd method on the StreamReader object.Add(file) Next file ' Done.Multiselect = True fo.FileNames() m_Zip. EventArgs e) { // Get list of files to add. Note that this function was designed to show the contents of short text files. e As EventArgs) Handles btnAdd.ShowDialog <> Windows.Next. Finally. . Add the following code to handle the Click event for the Add Files command button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnAdd_Click(sender As Object.DialogResult. Step 10: Add code to add entries to the zip file.

". Dim cnt As Integer = ListView1. e As EventArgs) Handles btnExtract. } } Adding new entries to a zip file is easy." dr = MessageBox. MessageBoxIcon.SelectedIndices.if (fo.ShowDialog() == DialogResult. Dim dr As DialogResult Dim msg As String msg = "Please confirm that you want to extract " + cnt.Count If cnt = 0 Then MessageBox. "C1Zip".Entries.OK Then Exit Sub ' Extract all selected entries Dim lvi As ListViewItem Dim ze As C1ZipEntry .. passing a string that contains the full name of the file to be added.Show("Sorry.Question) If dr <> Windows.FileNames) { m_Zip.Add(file).DialogResult. UpdateDisplay().Show(msg.OK) { // Add files in the list. Add the following code to handle the Click event for the Extract Files command button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnExtract_Click(sender As Object.ToString() + " entries. The main line simply calls the Add method on the C1ZipFile object. } // Done.Click ' Make sure we have some selected entries. "C1Zip") Exit Sub End If ' Confirm with user..OKCancel. Step 11: Add code to extract a zip entry. foreach (string file in fo. MessageBoxButtons. no files to extract. That’s all there is to it.Forms.

UpdateDisplay() End Sub To write code in C# C# Copy Code private void btnExtract_Click(object sender.".Extract(ze. MessageBoxButtons.Tag.OKCancel.SelectedItems ze = lvi..OK ) return.FileName) End If Next lvi ' Done. MessageBoxIcon. } } .For Each lvi In ListView1. foreach (ListViewItem lvi in ListView1.. "C1Zip". // Extract all selected entries.Tag If ze. dr = MessageBox.Show("Sorry.Entries.Extract(ze.SizeCompressed > 0 Then m_Zip. if ( dr != DialogResult. "C1Zip"). } // Confirm with user. DialogResult dr.SelectedIndices. if (cnt == 0) { MessageBox. msg = "Please confirm that you want to extract " + cnt.Count. int cnt = listView1.SizeCompressed > 0 ) { m_Zip. return. if ( ze.ToString() + " entries. string msg.FileName). EventArgs e) { // Make sure we have some selected entries.Entries.Show(msg.". no files to extract.Question). C1ZipEntry ze.SelectedItems) { ze = (C1ZipEntry)lvi.

Entries. the Extract method expands the entry and saves it in the same directory where the zip file is located..Tag m_Zip.// Done. Dim lvi As ListViewItem Dim ze As C1ZipEntry For Each lvi In ListView1. MessageBoxIcon.ToString() + " entries.. Step 12: Add code to remove entries from the zip file." dr = MessageBox. see the C1. "C1Zip". The parameter is the string that contains the file name of the entry (which is stored in the entry's FileName property).Click ' Make sure we have some selected entries.Forms.Show("Oops. By default.Question) If dr <> Windows.Show(msg. no files to remove.".OK Then Exit Sub ' Delete all selected entries. There are other versions of this method that allow you to specify the destination directory and file name for the expanded file. For more details.SelectedItems ze = lvi. "C1Zip") Exit Sub End If ' Confirm with user.SelectedIndices.DialogResult.OKCancel. e As EventArgs) Handles btnRemove.Remove(ze. } The most important line calls the Extract method on the Entries property of the C1ZipFile object.FileName) . MessageBoxButtons. Dim cnt As Integer = ListView1.C1Zip Namespace section. Dim dr As DialogResult Dim msg As String msg = "Please confirm that you want to delete " + cnt. UpdateDisplay(). Add the following code to handle the Click event for the Remove Files command button: To write code in Visual Basic Visual Basic Copy Code Private Sub btnRemove_Click(sender As Object.Count If cnt = 0 Then MessageBox.

int cnt = listView1. EventArgs e) { // Make sure we have some selected entries.Question).SelectedItems) { C1ZipEntry ze = (C1ZipEntry)lvi. } // Confirm with user.Show(msg.SizeCompressed > 0) { m_Zip. // Delete all selected entries. if (cnt == 0 ) { MessageBox.. This concludes the Handling Zip Files tutorial. "C1Zip").OK) return. UpdateDisplay() End Sub To write code in C# C# Copy Code private void btnRemove_Click(object sender. "C1Zip". UpdateDisplay(). MessageBoxButtons. no files to remove.Entries.Count. . foreach (ListViewItem lvi in listView1. The parameter is the string that contains the file name of the entry (which is stored in the entry's FileName property). dr = MessageBox. DialogResult dr. } The most important line calls the Remove method on the Entries property of the C1ZipFile object.Next lvi ' Done.ToString() + " entries.Remove(ze.FileName).OKCancel. } } // Done. if (dr != DialogResult. msg = "Please confirm that you want to delete " + cnt. string msg.Tag.". return.. MessageBoxIcon. if (ze.SelectedIndices.Show("Oops.".

visit ComponentOne. See Also C1. it would be better to add that information as a separate file instead.C1Zip. and there is a lot of debate still going on.C1Zip. All these limits are related to the types of variables used in the zip file specification. there's a proposed spec for 64-bit extensions to the zip format. The total length of the zip file is limited to 4 gigs. What is the maximum number of files that can be stored in a ZIP file? Same limit. but that's not widely used yet. However.C1Zip Namespace Overview Classes .NET Frequently Asked Questions Here are some frequently asked questions (FAQs) about Zip for .NET. API Reference The following topics contain the API reference for Zip for .NET: How much data can be stored in a ZIP file comment? I would like to use it to store information in XML. 32k entries. if you are going anywhere near that value.Zip for . For more FAQs about C1Zip. Interestingly.4 Assembly Namespaces C1. They are limited to 32k.4 Assembly C1.

ZipFileException Exception thrown when trying to open an invalid Zip file. opening.4 Assembly . and exposes information including the entry name.C1Zip. C1ZipEntryCollection A collection of C1ZipEntry objects that represent the contents of a zip file. Delegates Delegate Description ZipProgressEventHandler Represents the method that will handle the C1ZipFile. Enumerations Enumeration Description CompressionLevelEnum Specifies the level of compression to be applied when adding entries to a C1ZipFile. checksum. etc. ZipProgressEventArgs Provides data for the C1ZipFile.NET streams. C1ZStreamWriter Compresses data into .Progress event of a C1ZipFile. compressed and uncompressed sizes.NET Streams. C1ZStreamReader Decompresses data from .Class Description C1ZipEntry Represents an entry in a zip file. C1ZipFile Used for creating. and managing zip files. date. See Also Reference C1.Progress event of a C1ZipFile.

C1ZipEntry Requirements Target Platforms: Windows 7. compressed and uncompressed sizes. checksum. Object Model Syntax Visual Basic (Declaration) Public Class C1ZipEntry C# public class C1ZipEntry Inheritance Hierarchy System. Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later.C1Zip Namespace Overview Represents an entry in a zip file. etc. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. etc. compressed and uncompressed sizes. date. checksum. date. Windows Server 2003 SP2 See Also Reference C1ZipEntry Members C1. and exposes information including the entry name. Object Model . and exposes information including the entry name.Classes C1ZipEntry Represents an entry in a zip file.Object C1.C1Zip.

Windows XP SP3.C1Zip. CRC32 Gets the checksum calculated when the entry was compressed.C1ZipEntry Requirements Target Platforms: Windows 7.Object C1.Syntax Visual Basic (Declaration) Public Class C1ZipEntry C# public class C1ZipEntry Inheritance Hierarchy System. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later).C1Zip Namespace Members Properties Methods The following tables list the members exposed by C1ZipEntry. Windows Server 2003 SP2 See Also Reference C1ZipEntry Members C1. Date Gets the date and time when the file used to create the entry was . Public Properties Name Description Attributes Gets the file attributes associated with the entry. Windows Vista SP1 or later. Comment Gets or sets a comment associated with the entry.

Remove Top See Also Reference Removes this entry from the zip file. as a long integer.Stream that can be used to read the content of the entry without extracting it to a disk file. SizeCompressedLong Gets the compressed size of the entry. optionally including a path. CheckPassword Checks whether this C1ZipEntry can be read with the currently set password. in bytes. This is usually a file name.last modified. in bytes. Extract Extracts this entry to a file. in bytes. in bytes. SizeUncompressedLong Gets the original (uncompressed) size of the entry. IsEncrypted Gets a value that determines whether the entry is encrypted. as a long integer. Top Public Methods Name Description CheckCRC32 Calculates a checksum value for the entry and compares it to the checksum that was stored when the entry was created. SizeUncompressed Gets the original (uncompressed) size of the entry. . OpenReader Returns a System.IO. SizeCompressed Gets the compressed size of the entry. FileName Gets the entry name.

Stream that can be used to read the content of the entry without extracting it to a disk file. CheckPassword Checks whether this C1ZipEntry can be read with the currently set password. OpenReader Returns a System. Remove Removes this entry from the zip file.C1ZipEntry Class C1. Public Methods Name Description CheckCRC32 Calculates a checksum value for the entry and compares it to the checksum that was stored when the entry was created. Top See Also Reference C1ZipEntry Class C1.C1Zip Namespace Methods %%scrap%% " --> For a list of all members of this type. Syntax Visual Basic (Declaration) . Extract Extracts this entry to a file. see C1ZipEntry members.IO.C1Zip Namespace CheckCRC32 Method Calculates a checksum value for the entry and compares it to the checksum that was stored when the entry was created.

Remarks . Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members CheckPassword Method Checks whether this C1ZipEntry can be read with the currently set password. or if the entry is not encrypted. If the calculated checksum does not match the stored checksum. Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. then either the zip file is corrupted or the program used to create the zip file is incompatible with C1Zip. Syntax Visual Basic (Declaration) Public Function CheckPassword() As Boolean C# public bool CheckPassword() Return Value True if the entry can be read with the current password. Requirements Target Platforms: Windows 7. false otherwise. Remarks This method is used to check the integrity of the entries in the zip file.Public Function CheckCRC32() As Boolean C# public bool CheckCRC32() Return Value True if the checksum values match.

Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members Extract Method Name and location of the extracted file. Extracts this entry to a file. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also . Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later).This method is more efficient than using a try/catch block and trying to open the entry to determine whether the current password is valid for the entry. Windows Vista SP1 or later. Windows XP SP3. Syntax Visual Basic (Declaration) Public Sub Extract( _ ByVal destFileName As String _ ) C# public void Extract( string destFileName ) Parameters destFileName Name and location of the extracted file. Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Requirements Target Platforms: Windows 7.

Stream that can be used to read the content of the entry without extracting it to a disk file.IO.Reference C1ZipEntry Class C1ZipEntry Members OpenReader Method Returns a System.IO. Windows Server 2008 R2 (Server Core supported with SP1 or later). Syntax Visual Basic (Declaration) Public Function OpenReader() As Stream C# public Stream OpenReader() Return Value A System. Windows XP SP3. Windows Vista SP1 or later. which decompresses the data as it is read from the entry.Stream that can be used to read the data in the entry. Remarks The System. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members Remove Method Removes this entry from the zip file.IO. Requirements Target Platforms: Windows 7.Stream returned is a C1ZStreamReader. Syntax Visual Basic (Declaration) .

Public Sub Remove() C# public void Remove() Requirements Target Platforms: Windows 7. CRC32 Gets the checksum calculated when the entry was compressed. in bytes. Gets the entry name. optionally including a path. This is usually a file name. Date FileName Gets the date and time when the file used to create the entry was last modified. IsEncrypted Gets a value that determines whether the entry is encrypted. Windows Server 2008 (Server Core not supported). as a long integer. Windows Server 2008 R2 (Server Core supported with SP1 or later). SizeCompressedLong Gets the compressed size of the entry. Top . SizeCompressed Gets the compressed size of the entry. Windows XP SP3. Windows Vista SP1 or later. in bytes. Comment Gets or sets a comment associated with the entry. in bytes. in bytes. Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members Properties > Name Description Attributes Gets the file attributes associated with the entry. SizeUncompressed Gets the original (uncompressed) size of the entry. SizeUncompressedLong Gets the original (uncompressed) size of the entry. as a long integer.

set.} Requirements Target Platforms: Windows 7. Windows Vista SP1 or later.C1Zip Namespace Attributes Property Gets the file attributes associated with the entry. Syntax Visual Basic (Declaration) Public Property Comment As String C# public string Comment {get. Syntax Visual Basic (Declaration) Public ReadOnly Property Attributes As FileAttributes C# public FileAttributes Attributes {get. Windows XP SP3.} Requirements . Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later).See Also Reference C1ZipEntry Class C1. Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members Comment Property Gets or sets a comment associated with the entry.

Windows Vista SP1 or later.} Remarks This value can be used to check the integrity of the entry when it is decompressed. Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members Date Property Gets the date and time when the file used to create the entry was last modified. Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members CRC32 Property Gets the checksum calculated when the entry was compressed. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows XP SP3.Target Platforms: Windows 7. Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 R2 (Server Core supported with SP1 or later). Syntax Visual Basic (Declaration) Public ReadOnly Property CRC32 As Integer C# public int CRC32 {get. Windows Server 2008 (Server Core not supported). Syntax .

} Remarks This value can be used to check whether an entry needs to be updated because the source file was modified since it was last compressed. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members FileName Property Gets the entry name. optionally including a path. Windows Server 2008 R2 (Server Core supported with SP1 or later). This is usually a file name. Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public ReadOnly Property FileName As String C# public string FileName {get. Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported).} Requirements Target Platforms: Windows 7. Windows XP SP3. Windows XP SP3. Windows Server 2003 SP2 See Also .Visual Basic (Declaration) Public ReadOnly Property Date As Date C# public DateTime Date {get.

Reference C1ZipEntry Class C1ZipEntry Members IsEncrypted Property Gets a value that determines whether the entry is encrypted. Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members SizeCompressed Property Gets the compressed size of the entry. Windows Server 2008 (Server Core not supported).} Remarks Encrypted entries can only be extracted if the C1ZipFile. Windows Vista SP1 or later.Password property on the containing C1ZipFile object is set to the password that was used when the file was added to the zip file. in bytes. Requirements Target Platforms: Windows 7. Syntax Visual Basic (Declaration) Public ReadOnly Property SizeCompressed As Integer C# . Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Syntax Visual Basic (Declaration) Public ReadOnly Property IsEncrypted As Boolean C# public bool IsEncrypted {get.

in bytes. Syntax Visual Basic (Declaration) Public ReadOnly Property SizeCompressedLong As Long C# public long SizeCompressedLong {get.} Requirements Target Platforms: Windows 7. Syntax . Windows Vista SP1 or later. as a long integer. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members SizeUncompressed Property Gets the original (uncompressed) size of the entry. Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members SizeCompressedLong Property Gets the compressed size of the entry. Windows Server 2008 R2 (Server Core supported with SP1 or later). in bytes.} Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later).public int SizeCompressed {get.

Windows XP SP3. as a long integer. Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members SizeUncompressedLong Property Gets the original (uncompressed) size of the entry. Windows Server 2008 R2 (Server Core supported with SP1 or later).} Requirements Target Platforms: Windows 7. Syntax Visual Basic (Declaration) Public ReadOnly Property SizeUncompressedLong As Long C# public long SizeUncompressedLong {get.Visual Basic (Declaration) Public ReadOnly Property SizeUncompressed As Integer C# public int SizeUncompressed {get. in bytes. Windows Server 2008 (Server Core not supported). Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference C1ZipEntry Class C1ZipEntry Members .} Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. Windows Vista SP1 or later.

C1ZipEntryCollection
A collection of C1ZipEntry objects that represent the contents of a zip file.

Object Model

Syntax
Visual Basic (Declaration)
Public Class C1ZipEntryCollection
C#
public class C1ZipEntryCollection

Remarks
Use the C1ZipEntryCollection to programmatically manage the contents of zip files. You can
add, remove, extract, or insert items into the C1ZipEntryCollection.

Inheritance Hierarchy
System.Object
C1.C1Zip.C1ZipEntryCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
C1ZipEntryCollection Members
C1.C1Zip Namespace

Overview
A collection of C1ZipEntry objects that represent the contents of a zip file.

Object Model

Syntax
Visual Basic (Declaration)
Public Class C1ZipEntryCollection
C#
public class C1ZipEntryCollection

Remarks
Use the C1ZipEntryCollection to programmatically manage the contents of zip files. You can
add, remove, extract, or insert items into the C1ZipEntryCollection.

Inheritance Hierarchy
System.Object
C1.C1Zip.C1ZipEntryCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
C1ZipEntryCollection Members
C1.C1Zip Namespace

Members
For internal use only.

Syntax
Visual Basic (Declaration)
Public Shadows ReadOnly Property Items As
System.Windows.Forms.ListView.ListViewItemCollection

C#
public new System.Windows.Forms.ListView.ListViewItemCollection Items {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
C1PreviewThumbnailView Class
C1PreviewThumbnailView Members

Methods
%%scrap%%
" -->
For a list of all members of this type, see C1ZipEntryCollection members.

Public Methods
Name

Description

Add

Overloaded. Adds an entry to the current zip file.

AddFolder

Overloaded. Adds the content of a folder to the current zip file.

Contains

Overloaded. Determines whether the collection contains an entry with a
given name.

Extract

Overloaded. Extracts a file from the current zip file.

ExtractFolder

Extracts the contents of the zip file into a specified path.

IndexOf

Overloaded. Gets the index of the entry with the specified name.

OpenWriter

Overloaded. Opens a stream for writing an entry into the zip file.

Remove

Overloaded. Removes an entry from the current zip file.

Top

See Also
Reference
C1ZipEntryCollection Class
C1.C1Zip Namespace

Add Method
Adds an entry to the current zip file.

Overload List
Overload

Description

Add(String)

Adds an entry to the current zip file.

Add(String[])

Adds a list of entries to the current zip file.

Add(String,Int32)

Adds an entry to the current zip file.

Add(String,String)

Adds an entry to the current zip file.

Add(String,String,DateTime)

Adds an entry to the current zip file.

Add(Stream,String)

Adds a stream to the current zip file.

Add(Stream,String,DateTime) Adds a stream to the current zip file.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
C1ZipEntryCollection Class
C1ZipEntryCollection Members

Add(String) Method
Name of the file to add to the zip file.
Adds an entry to the current zip file.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Add( _
ByVal fileName As String _
)
C#
public void Add(
string fileName
)

Parameters
fileName
Name of the file to add to the zip file.

Remarks
By default, the directory name is not stored in the zip file. To store a specific part of the
directory name in the zip file, use the overloaded version of the Add method with a
pathLevels parameter.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported
with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1ZipEntryCollection Class
C1ZipEntryCollection Members
Overload List

Add(String[]) Method
Array containing the file names of the entries to be added to the zip file.

Adds a list of entries to the current zip file. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Add(String. Syntax Visual Basic (Declaration) Public Overloads Sub Add( _ ByVal fileNames() As String _ ) C# public void Add( string[] fileNames ) Parameters fileNames Array containing the file names of the entries to be added to the zip file.Int32) Method Name of the file to add to the zip file. The number of path levels to be stored as the entry name. Adds an entry to the current zip file. Windows Vista SP1 or later. Requirements Target Platforms: Windows 7. Syntax Visual Basic (Declaration) . Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later).

txt" to the zip file with pathLevels=1 will create an entry called "samples\readme.Public Overloads Sub Add( _ ByVal fileName As String. Windows XP SP3.txt". The pathLevels parameter allows you to store one or more levels of the path in the entry name. Windows Server 2008 R2 (Server Core supported with SP1 or later). Remarks By default. Windows Server 2008 (Server Core not supported). . int pathLevels ) Parameters fileName Name of the file to add to the zip file. adding the file "c:\temp\samples\readme.txt". Windows Vista SP1 or later. For example.txt" to the zip file will create an entry called "readme. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Add(String. Requirements Target Platforms: Windows 7.String) Method Name of the file to add to the zip file. pathLevels The number of path levels to be stored as the entry name. adding the file "c:\temp\samples\readme. path names are not stored in the zip file. For example. Name of the new entry as stored in the zip file. _ ByVal pathLevels As Integer _ ) C# public void Add( string fileName.

Windows Server 2008 (Server Core not supported). This method allows you to specify a different name. Requirements Target Platforms: Windows 7.Adds an entry to the current zip file. entries in the zip file have the same name as the original (uncompressed) file. _ ByVal entryName As String _ ) C# public void Add( string fileName. Remarks By default. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List . string entryName ) Parameters fileName Name of the file to add to the zip file. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. including a path for example. entryName Name of the new entry as stored in the zip file. Syntax Visual Basic (Declaration) Public Overloads Sub Add( _ ByVal fileName As String.

entries in the zip file have the same name as the original (uncompressed) file. entryName Name of the new entry as stored in the zip file.Add(String. Adds an entry to the current zip file. dateTime The date and time when the file was last modified. Syntax Visual Basic (Declaration) Public Overloads Sub Add( _ ByVal fileName As String.DateTime) Method Name of the file to add to the zip file. Name of the new entry as stored in the zip file. This method allows you to specify a different name. DateTime dateTime ) Parameters fileName Name of the file to add to the zip file. string entryName. Requirements . Remarks By default.String. including a path for example. _ ByVal entryName As String. The date and time when the file was last modified. _ ByVal dateTime As Date _ ) C# public void Add( string fileName.

String) Method Stream that contains data for the new entry.Target Platforms: Windows 7. Name to be used for the new entry. Windows XP SP3. _ ByVal entryName As String _ ) C# public void Add( Stream stream. Adds a stream to the current zip file. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Add(Stream. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). string entryName ) Parameters stream Stream that contains data for the new entry. Syntax Visual Basic (Declaration) Public Overloads Sub Add( _ ByVal stream As Stream. Requirements . entryName Name to be used for the new entry. Windows Server 2008 R2 (Server Core supported with SP1 or later).

Syntax Visual Basic (Declaration) Public Overloads Sub Add( _ ByVal stream As Stream.DateTime) Method Stream that contains data for the new entry.String.Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Add(Stream. Windows Server 2008 R2 (Server Core supported with SP1 or later). _ ByVal dateTime As Date _ ) C# public void Add( Stream stream. entryName Name to be used for the new entry. DateTime dateTime ) Parameters stream Stream that contains data for the new entry. . The date and time when the file was last modified. _ ByVal entryName As String. string entryName. Windows Vista SP1 or later. Windows XP SP3. Name to be used for the new entry. Windows Server 2008 (Server Core not supported). Adds a stream to the current zip file.

Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List AddFolder Method Adds the content of a folder to the current zip file. .String) Adds the content of a folder to the current zip file. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members AddFolder(String) Method The full path of the folder to be added to the zip file. AddFolder(String. Overload List Overload Description AddFolder(String) Adds the content of a folder to the current zip file.dateTime The date and time when the file was last modified. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later).String. Requirements Target Platforms: Windows 7. Requirements Target Platforms: Windows 7. AddFolder(String. Windows Server 2008 (Server Core not supported).Boolean) Adds the content of a folder to the current zip file.

Adds the content of a folder to the current zip file. Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later).String) Method The full path of the folder to be added to the zip file. Requirements Target Platforms: Windows 7. Remarks This method adds all files and sub folders to the zip file. A mask that specifies which files to add. Windows Server 2008 (Server Core not supported). Adds the content of a folder to the current zip file. Windows XP SP3. Syntax Visual Basic (Declaration) Public Overloads Sub AddFolder( _ ByVal path As String _ ) C# public void AddFolder( string path ) Parameters path The full path of the folder to be added to the zip file. Syntax . Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List AddFolder(String.

those are also added to the zip file. .Visual Basic (Declaration) Public Overloads Sub AddFolder( _ ByVal path As String. Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List AddFolder(String. Windows XP SP3. _ ByVal searchPattern As String _ ) C# public void AddFolder( string path. Remarks If the folder contains sub folders. false to include only files at the root level. searchPattern A mask that specifies which files to add. Windows Vista SP1 or later. True to include sub folders. string searchPattern ) Parameters path The full path of the folder to be added to the zip file. A mask that specifies which files to add.Boolean) Method The full path of the folder to be added to the zip file.String. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported).

includeSubfolders True to include sub folders. searchPattern A mask that specifies which files to add. Syntax Visual Basic (Declaration) Public Overloads Sub AddFolder( _ ByVal path As String.Adds the content of a folder to the current zip file. Windows Vista SP1 or later. Windows XP SP3. Requirements Target Platforms: Windows 7. _ ByVal searchPattern As String. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List . Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). _ ByVal includeSubfolders As Boolean _ ) C# public void AddFolder( string path. false to include only files at the root level. bool includeSubfolders ) Parameters path The full path of the folder to be added to the zip file. string searchPattern.

Syntax Visual Basic (Declaration) Public Overloads Function Contains( _ ByVal name As String _ ) As Boolean C# public bool Contains( string name ) Parameters name . Windows Vista SP1 or later. Requirements Target Platforms: Windows 7. Contains(C1ZipEntry) Determines whether the collection contains an entry.Contains Method Determines whether the collection contains an entry with a given name. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Overload List Overload Description Contains(String) Determines whether the collection contains an entry with a given name. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Contains(String) Method Name of the entry to look for. Windows XP SP3. Determines whether the collection contains an entry with a given name.

Requirements Target Platforms: Windows 7. false otherwise. Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Contains(C1ZipEntry) Method Entry of the entry to look for. . Return Value True if the collection contains an entry with the given name. false otherwise. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Determines whether the collection contains an entry. Syntax Visual Basic (Declaration) Public Overloads Function Contains( _ ByVal entry As C1ZipEntry _ ) As Boolean C# public bool Contains( C1ZipEntry entry ) Parameters entry Entry of the entry to look for. Return Value True if the collection contains the entry. Windows Server 2008 (Server Core not supported).Name of the entry to look for.

Windows Vista SP1 or later.String) Extracts a file from the current zip file. Extract(String) Extracts a file from the current zip file. Extract(Int32) Extracts a file from the current zip file.Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Extract(Int32. Windows XP SP3. Windows Server 2008 (Server Core not supported). Windows XP SP3.String) Method Index of the entry to extract. Windows Vista SP1 or later. Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later).String) Extracts a file from the current zip file. Overload List Overload Description Extract(Int32. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Extract Method Extracts a file from the current zip file. . Extract(String.

Name and location of the extracted file. Windows XP SP3. Extracts a file from the current zip file. Windows Server 2008 R2 (Server Core supported with SP1 or later). string destFileName ) Parameters index Index of the entry to extract. destFileName Name and location of the extracted file. . Windows Vista SP1 or later. _ ByVal destFileName As String _ ) C# public void Extract( int index.String) Method Name of the entry to extract. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Extract(String. Name and location of the extracted file. Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Syntax Visual Basic (Declaration) Public Overloads Sub Extract( _ ByVal index As Integer.

Attaches the tools integrator to the specified toolstrip. Windows XP SP3. Windows Vista SP1 or later. destFileName Name and location of the extracted file. If the toolstrip contains preview items. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Extract(Int32) Method The toolstrip to attach to. Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). _ ByVal destFileName As String _ ) C# public void Extract( string entryName.Extracts a file from the current zip file. Syntax Visual Basic (Declaration) Public Overloads Sub Extract( _ ByVal entryName As String. . string destFileName ) Parameters entryName Name of the entry to extract. Windows Server 2008 R2 (Server Core supported with SP1 or later). they will be handled by the tools integrator.

Requirements Target Platforms: Windows 7.ToolStrip _ ) C# public void AttachToolStrip( System.ToolStrip toolstrip ) Parameters toolstrip The toolstrip to attach to. Syntax Visual Basic (Declaration) Public Overloads Sub Extract( _ ByVal entryName As String _ ) C# . Extracts a file from the current zip file.Syntax Visual Basic (Declaration) Public Sub AttachToolStrip( _ ByVal toolstrip As System.Forms. Windows Vista SP1 or later.Windows. Windows Server 2008 R2 (Server Core supported with SP1 or later).Forms. Windows Server 2008 (Server Core not supported). Windows XP SP3.Windows. Windows Server 2003 SP2 See Also Reference C1PreviewToolsIntegrator Class C1PreviewToolsIntegrator Members Extract(String) Method Name of the entry to extract.

Windows XP SP3. Syntax Visual Basic (Declaration) Public Sub ExtractFolder( _ ByVal path As String _ ) C# public void ExtractFolder( string path ) . Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List ExtractFolder Method Destination path for the unzipped files. Windows Server 2008 R2 (Server Core supported with SP1 or later). Extracts the contents of the zip file into a specified path.public void Extract( string entryName ) Parameters entryName Name of the entry to extract. Requirements Target Platforms: Windows 7. Remarks The entry is extracted to a file in the same folder as the current zip file. with the same name as the entry.

Windows Server 2008 R2 (Server Core supported with SP1 or later). Remarks If the zip file contains compressed folders. Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members IndexOf Method Gets the index of the entry with the specified name. IndexOf(C1ZipEntry) Gets the index of an entry in the collection. new folders will be created under the destination path to preserve the hierarchical structure of the archive. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Windows XP SP3. Overload List Overload Description IndexOf(String) Gets the index of the entry with the specified name. Windows XP SP3. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference . Windows Vista SP1 or later. Requirements Target Platforms: Windows 7.Parameters path Destination path for the unzipped files. Requirements Target Platforms: Windows 7.

C1ZipEntryCollection Class C1ZipEntryCollection Members IndexOf(String) Method Name of the entry to look for. Gets the index of the entry with the specified name. Windows Server 2008 (Server Core not supported). Syntax Visual Basic (Declaration) Public Overloads Function IndexOf( _ ByVal name As String _ ) As Integer C# public int IndexOf( string name ) Parameters name Name of the entry to look for. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). . Return Value The index of the entry in the collection. or -1 if the entry was not found. Windows Vista SP1 or later. Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List IndexOf(C1ZipEntry) Method C1ZipEntry to look for.

Requirements Target Platforms: Windows 7. or -1 if the entry was not found. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List OpenWriter Method For internal use.Gets the index of an entry in the collection. Windows Vista SP1 or later. Return Value The index of the entry in the collection. Syntax Visual Basic (Declaration) Public Overloads Function IndexOf( _ ByVal entry As C1ZipEntry _ ) As Integer C# public int IndexOf( C1ZipEntry entry ) Parameters entry C1ZipEntry to look for. Windows Server 2008 R2 (Server Core supported with SP1 or later). Overload List Overload Description . Windows XP SP3.

Opens a stream for writing an entry into the zip file. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). bool useMemory ) Parameters entryName The name of the new entry. FileSave(String. Requirements Target Platforms: Windows 7.FileSave() For internal use. Whether to use a memory stream or temporary file. Windows Server 2003 SP2 See Also Reference C1PreviewToolsIntegrator Class C1PreviewToolsIntegrator Members OpenWriter(String. _ ByVal useMemory As Boolean _ ) As Stream C# public Stream OpenWriter( string entryName. Syntax Visual Basic (Declaration) Public Overloads Function OpenWriter( _ ByVal entryName As String. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). useMemory .Boolean) Method The name of the new entry.ExportProvider) For internal use.

Windows XP SP3. Return Value A stream that can be used to write data into the zip file.Boolean) Method The name of the new entry. DateTime dateTime. Whether to use a memory stream or temporary file. bool useMemory ) . Requirements Target Platforms: Windows 7. _ ByVal dateTime As Date. Windows Vista SP1 or later.DateTime.Whether to use a memory stream or temporary file. _ ByVal useMemory As Boolean _ ) As Stream C# public Stream OpenWriter( string entryName. Syntax Visual Basic (Declaration) Public Overloads Function OpenWriter( _ ByVal entryName As String. Windows Server 2008 R2 (Server Core supported with SP1 or later). The date and time when the file was last modified. Opens a stream for writing an entry into the zip file. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List OpenWriter(String. Windows Server 2008 (Server Core not supported). The entry is not added until the stream is closed.

Overload List Overload Description Remove(Int32) Removes an entry from the current zip file. Remove(Int32[]) Removes several entries from the current zip file. Windows XP SP3. Requirements Target Platforms: Windows 7. useMemory Whether to use a memory stream or temporary file. . dateTime The date and time when the file was last modified.Parameters entryName The name of the new entry. The entry is not added until the stream is closed. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Remove Method Removes an entry from the current zip file. Windows Server 2008 (Server Core not supported). Return Value A stream that can be used to write data into the zip file. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Remove(String) Removes an entry from the current zip file.

Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Remove(Int32) Method Index of the entry to remove. Windows Vista SP1 or later. Requirements Target Platforms: Windows 7. Windows XP SP3. Syntax Visual Basic (Declaration) Public Overloads Sub Remove( _ ByVal index As Integer _ ) C# public void Remove( int index ) Parameters index Index of the entry to remove. Windows XP SP3. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Requirements Target Platforms: Windows 7.Remove(String[]) Removes several entries from the current zip file. Windows Server 2003 SP2 See Also . Windows Server 2008 R2 (Server Core supported with SP1 or later). Removes an entry from the current zip file.

Windows XP SP3. . Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Remove(Int32[]) Method Array containing the indices of the entries to remove. Removes an entry from the current zip file. Removes several entries from the current zip file.Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Remove(String) Method Name of the entry to remove (case-insensitive). Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Syntax Visual Basic (Declaration) Public Overloads Sub Remove( _ ByVal fileName As String _ ) C# public void Remove( string fileName ) Parameters fileName Name of the entry to remove (case-insensitive). Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later).

Windows Vista SP1 or later.Syntax Visual Basic (Declaration) Public Overloads Sub Remove( _ ByVal indices() As Integer _ ) C# public void Remove( int[] indices ) Parameters indices Array containing the indices of the entries to remove. Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Remove(String[]) Method Array containing the names of the entries to remove. Syntax Visual Basic (Declaration) Public Overloads Sub Remove( _ ByVal entryNames() As String _ ) . Requirements Target Platforms: Windows 7. Removes several entries from the current zip file. Windows Server 2008 R2 (Server Core supported with SP1 or later).

Windows Server 2008 R2 (Server Core supported with SP1 or later).C1Zip Namespace Count Property Gets the number of entries in the current zip file. Top See Also Reference C1ZipEntryCollection Class C1.C# public void Remove( string[] entryNames ) Parameters entryNames Array containing the names of the entries to remove. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Properties > Name Description Count Gets the number of entries in the current zip file. Item Overloaded. Gets the C1ZipEntry at the specified index. Requirements Target Platforms: Windows 7. Syntax . Windows Vista SP1 or later. Windows XP SP3.

Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Item Property Gets the C1ZipEntry at the specified index.Visual Basic (Declaration) Public ReadOnly Property Count As Integer C# public int Count {get. Windows XP SP3. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Windows Vista SP1 or later. Windows Vista SP1 or later.} Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members . Requirements Target Platforms: Windows 7. Overload List Overload Description Item(Int32) Gets the C1ZipEntry at the specified index. Windows Server 2008 (Server Core not supported). Item(String) Gets the C1ZipEntry with the given name (returns null if the entry cannot be found). Windows Server 2008 R2 (Server Core supported with SP1 or later).

Syntax Visual Basic (Declaration) Public Overloads ReadOnly Property Item( _ ByVal index As Integer _ ) As C1ZipEntry C# public C1ZipEntry Item( int index ) {get.} Parameters index Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List Item(String) Property Gets the C1ZipEntry with the given name (returns null if the entry cannot be found). Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later).Item(Int32) Property Gets the C1ZipEntry at the specified index. Syntax Visual Basic (Declaration) Public Overloads ReadOnly Property Item( _ ByVal name As String _ ) As C1ZipEntry . Windows Vista SP1 or later. Windows XP SP3.

Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZipEntryCollection Class C1ZipEntryCollection Members Overload List C1ZipFile Example Used for creating. Windows Server 2008 (Server Core not supported). opening.} Parameters name Requirements Target Platforms: Windows 7. Object Model Syntax Visual Basic (Declaration) Public Class C1ZipFile C# public class C1ZipFile Remarks . Windows Server 2008 R2 (Server Core supported with SP1 or later).C# public C1ZipEntry Item( string name ) {get. Windows Vista SP1 or later. and managing zip files.

zip. Windows Server 2003 SP2 See Also Reference . Windows Server 2008 R2 (Server Core supported with SP1 or later).SizeUncompressed.GetFiles(path. // add all files with extension cs to the zip file foreach (string fileName in Directory. ze.C1ZipFile Requirements Target Platforms: Windows 7.MaxValue).Substring(0. Windows Vista SP1 or later. ze. Windows XP SP3.ExecutablePath. ze. } Inheritance Hierarchy System. int pos = path. "*.zip"). path = path.zip and adds all files with a "cs" extension to the zip file:  C# // get path for zip file and files to compress string path = Application.IndexOf(@"\bin"). Then use the Entries property to add.FileName. C1ZipFile can only be used with standard zip files. or rar. retrieve. Windows Server 2008 (Server Core not supported). remove. // show result foreach (C1ZipEntry ze in zip. zip2.Create(path + "source. // create a zip file C1ZipFile zip = new C1ZipFile().C1Zip. The component does not support other similar formats such as gzip.Entries.##0} {2:#.Add(fileName). You cannot use it to compress files larger than 4 gigabytes (uint.Object C1.##0}". Example The code below creates a zip file called sources.SizeCompressed). pos + 1). or inspect individual entries in the zip file.Entries) { Console.cs")) zip.Use the Open(String) or Create(String) methods to associate the C1Zip file object with a zip file on disk.WriteLine("{0} {1:#. tar. The standard zip file imposes some limitations on the size of each entry.

and managing zip files.MaxValue).zip and adds all files with a "cs" extension to the zip file:  C# // get path for zip file and files to compress string path = Application. tar. C1ZipFile can only be used with standard zip files.Substring(0. The component does not support other similar formats such as gzip. The standard zip file imposes some limitations on the size of each entry. Example The code below creates a zip file called sources.C1Zip Namespace Overview Example Used for creating.ExecutablePath. zip2. pos + 1). opening. or inspect individual entries in the zip file. Then use the Entries property to add. path = path. int pos = path. zip.Create(path + "source. Object Model Syntax Visual Basic (Declaration) Public Class C1ZipFile C# public class C1ZipFile Remarks Use the Open(String) or Create(String) methods to associate the C1Zip file object with a zip file on disk. You cannot use it to compress files larger than 4 gigabytes (uint. remove.IndexOf(@"\bin"). retrieve. or rar.zip"). .C1ZipFile Members C1. // create a zip file C1ZipFile zip = new C1ZipFile().

.SizeUncompressed.// add all files with extension cs to the zip file foreach (string fileName in Directory. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. // show result foreach (C1ZipEntry ze in zip. ze.##0} {2:#.FileName. Top Public Properties Name Description Comment Gets or sets a comment associated with the current zip file.Entries) { Console. Windows XP SP3.C1Zip Namespace Members Properties Methods Events The following tables list the members exposed by C1ZipFile.##0}".cs")) zip.Entries.Add(fileName).C1ZipFile Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). "*. ze. ze.Object C1.WriteLine("{0} {1:#.C1Zip. } Inheritance Hierarchy System. Windows Server 2003 SP2 See Also Reference C1ZipFile Members C1.GetFiles(path.SizeCompressed). Public Constructors Name Description C1ZipFile Constructor Overloaded.

CloseBatch Closes a zip file after it was opened with a call to the OpenBatch method. Top Public Methods Name Description Close Resets all data members of the C1ZipFile object. OverwriteReadOnly Determines whether the component should overwrite read-only files when extracting entries from the zip file. Entries Gets a C1ZipEntryCollection that contains the entries in the zip file. OverwriteSystem Determines whether the component should overwrite system files when extracting entries from the zip file. MemoryThreshold Gets or sets the size of the largest stream to be compressed in memory. Password Gets or sets the password to use when adding or retrieving entries from the zip file. UseUtf8Encoding Determines whether file names and comments should be stored in UTF8 format. OverwriteHidden Determines whether the component should overwrite hidden files when extracting entries from the zip file. FileName Gets the name of the current zip file. TempFileName Gets or sets the name of the temporary file to use when adding entries to the zip file.CompressionLevel Gets or sets the compression level to use when adding entries to the zip file. .

Creates an empty zip file on disk. Open Overloaded. . IsZipFile Overloaded. Top See Also Reference C1ZipFile Class C1. Tests whether a file is a valid zip file. Opens an existing zip file. C1ZipFile Constructor(String. Refresh Refreshes all data members by re-opening the current zip file.Boolean) Initializes a new instance of the C1ZipFile class and creates or opens a zip file associated with this new instance.Create Overloaded. Top Public Events Name Description Progress Fired while data is being read from or written into a zip file.C1Zip Namespace C1ZipFile Constructor Overload List Overload Description C1ZipFile Constructor() Initializes a new instance of the C1ZipFile class. C1ZipFile Constructor(String) Initializes a new instance of the C1ZipFile class and opens a zip file associated with this new instance. OpenBatch Opens the zip file for multiple operations.

C1ZipFile Constructor(Stream. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public Function New() C# public C1ZipFile() Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later).Boolean) Initializes a new instance of the C1ZipFile class and opens a zip stream associated with this new instance. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members C1ZipFile Constructor() Initializes a new instance of the C1ZipFile class. C1ZipFile Constructor(Stream) Initializes a new instance of the C1ZipFile class and opens a zip stream associated with this new instance. Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members Overload List . Windows XP SP3. Requirements Target Platforms: Windows 7.

_ ByVal create As Boolean _ ) C# public C1ZipFile( string fileName. Syntax Visual Basic (Declaration) Public Function New( _ ByVal fileName As String. false to open an existing file. Remarks If create is true and the zip file already exists. Windows Server 2003 SP2 See Also . Windows XP SP3.C1ZipFile Constructor(String. false to open an existing file. True to create a new zip file. Initializes a new instance of the C1ZipFile class and creates or opens a zip file associated with this new instance. Windows Server 2008 R2 (Server Core supported with SP1 or later). If create is false and the zip file already exists. create True to create a new zip file. Windows Server 2008 (Server Core not supported). it is overwritten with a new empty file.Boolean) The name of the zip file to open or create. Windows Vista SP1 or later. the existing file is opened. Requirements Target Platforms: Windows 7. bool create ) Parameters fileName The name of the zip file to open or create.

a new empty file is created. Windows XP SP3. Remarks If the file does not exist. Requirements Target Platforms: Windows 7. Initializes a new instance of the C1ZipFile class and opens a zip file associated with this new instance. Windows Server 2003 SP2 See Also Reference . Windows Server 2008 (Server Core not supported).Reference C1ZipFile Class C1ZipFile Members Overload List C1ZipFile Constructor(String) The name of the zip file to open. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public Function New( _ ByVal fileName As String _ ) C# public C1ZipFile( string fileName ) Parameters fileName The name of the zip file to open.

Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also .Stream that contains the zip data. _ ByVal create As Boolean _ ) C# public C1ZipFile( Stream stream.Stream that contains the zip data.IO. Initializes a new instance of the C1ZipFile class and opens a zip stream associated with this new instance. create Whether to initialize the stream with an empty zip header or open an existing zip file in the stream. Windows Server 2008 R2 (Server Core supported with SP1 or later).C1ZipFile Class C1ZipFile Members Overload List C1ZipFile Constructor(Stream. Windows XP SP3. Windows Vista SP1 or later.IO.Boolean) System. bool create ) Parameters stream System. Whether to initialize the stream with an empty zip header or open an existing zip file in the stream. Syntax Visual Basic (Declaration) Public Function New( _ ByVal stream As Stream. Windows Server 2008 (Server Core not supported).

Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members Overload List Methods %%scrap%% . Initializes a new instance of the C1ZipFile class and opens a zip stream associated with this new instance.Stream that contains the zip data. Windows Server 2008 (Server Core not supported). Syntax Visual Basic (Declaration) Public Function New( _ ByVal stream As Stream _ ) C# public C1ZipFile( Stream stream ) Parameters stream System. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Requirements Target Platforms: Windows 7.Stream that contains the zip data.Reference C1ZipFile Class C1ZipFile Members Overload List C1ZipFile Constructor(Stream) System.IO.IO.

see C1ZipFile members. Syntax Visual Basic (Declaration) Public Sub Close() C# public void Close() . IsZipFile Overloaded. Open Overloaded. Tests whether a file is a valid zip file. Refresh Refreshes all data members by re-opening the current zip file. CloseBatch Closes a zip file after it was opened with a call to the OpenBatch method. Create Overloaded. Creates an empty zip file on disk. OpenBatch Opens the zip file for multiple operations. Opens an existing zip file. Top See Also Reference C1ZipFile Class C1.C1Zip Namespace Close Method Resets all data members of the C1ZipFile object." --> For a list of all members of this type. Public Methods Name Description Close Resets all data members of the C1ZipFile object.

Syntax Visual Basic (Declaration) Public Sub CloseBatch() C# public void CloseBatch() Remarks See the OpenBatch method for a complete description and a sample. You only need to use this method if you want to break the connection between a C1ZipFile class and a physical zip file. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later.Remarks Disk files are automatically closed by C1Zip. Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members . Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Windows XP SP3. Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members CloseBatch Method Closes a zip file after it was opened with a call to the OpenBatch method.

Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members Create(String) Method The name of the zip file to create. Creates an empty zip file on disk. Windows Server 2008 (Server Core not supported). Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Overload List Overload Description Create(String) Creates an empty zip file on disk. Syntax Visual Basic (Declaration) Public Overloads Sub Create( _ ByVal fileName As String _ ) C# public void Create( string fileName ) Parameters fileName . Create(Stream) Creates a new zip file in a stream. Windows Vista SP1 or later. Windows XP SP3. including the path.Create Method Creates an empty zip file on disk.

Requirements Target Platforms: Windows 7. it is deleted before the new one is created.The name of the zip file to create.IO. Creates a new zip file in a stream.Stream that will contain the new zip file. including the path. Windows Server 2008 R2 (Server Core supported with SP1 or later).IO. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members Overload List Create(Stream) Method Example System. Remarks If a file by the same name already exists. Windows XP SP3. Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public Overloads Sub Create( _ ByVal stream As Stream _ ) C# public void Create( Stream stream ) Parameters stream System.Stream that will contain the new zip file. Windows Server 2008 (Server Core not supported). Example .

The code below creates a new C1ZipFile on a memory stream, then adds several files to it.
Finally, the code gets the zipped data out as an array of bytes, which could be stored in a
database for example.

C#

// create zip on a stream
MemoryStream msZip = new MemoryStream();
C1ZipFile zip = new C1ZipFile(msZip, true);
// add some entries to it
foreach (string f in Directory.GetFiles(@"c:\WINDOWS\Web\Wallpaper"))
{
zip.Entries.Add(f);
}
// get zipped data out as a byte array
byte[] zipData = msZip.ToArray();

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported
with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1ZipFile Class
C1ZipFile Members
Overload List

IsZipFile Method
Tests whether a file is a valid zip file.

Overload List
Overload

Description

IsZipFile(String)

Tests whether a file is a valid zip file.

IsZipFile(Stream)

Tests whether a stream contains a valid zip file.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
C1ZipFile Class
C1ZipFile Members

IsZipFile(String) Method
Name of the file to test.
Tests whether a file is a valid zip file.

Syntax
Visual Basic (Declaration)
Public Overloads Shared Function IsZipFile( _
ByVal fileName As String _
) As Boolean
C#
public static bool IsZipFile(
string fileName
)

Parameters
fileName
Name of the file to test.

Return Value
True if the file exists and is a valid zip file, false otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported
with SP1 or later), Windows Server 2003 SP2

See Also
Reference

C1ZipFile Class
C1ZipFile Members
Overload List

IsZipFile(Stream) Method
System.IO.Stream to test.
Tests whether a stream contains a valid zip file.

Syntax
Visual Basic (Declaration)
Public Overloads Shared Function IsZipFile( _
ByVal stream As Stream _
) As Boolean
C#
public static bool IsZipFile(
Stream stream
)

Parameters
stream
System.IO.Stream to test.

Return Value
True if stream contains a valid zip file, false otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported
with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1ZipFile Class
C1ZipFile Members
Overload List

Open Method
Opens an existing zip file.

Overload List
Overload

Description

Open(String)

Opens an existing zip file.

Open(Stream)

Opens an existing zip file stored in a stream.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
C1ZipFile Class
C1ZipFile Members

Open(String) Method
The name of an existing zip file, including the path.
Opens an existing zip file.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Open( _
ByVal fileName As String _
)
C#
public void Open(
string fileName
)

Parameters
fileName
The name of an existing zip file, including the path.

Remarks
This method checks that the zip file exists and is a valid zip file, then reads the zip file
directory into the Entries collection. The zip file is then closed, and can be used by other
applications. There is no need to close the zip file explicitly.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported
with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1ZipFile Class
C1ZipFile Members
Overload List

Open(Stream) Method
Example

System.IO.Stream that contains a zip file.
Opens an existing zip file stored in a stream.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Open( _
ByVal stream As Stream _
)
C#
public void Open(
Stream stream
)

Parameters
stream
System.IO.Stream that contains a zip file.

Remarks

FileName. menu option.EndsWith(".GetManifestResourceStream("MyApp.test.Show(sr. using (Stream stream = a.zip")) { // open C1ZipFile on the stream zip. ze.Entries) { // show entries that have a 'txt' extension. Windows XP SP3. select the Add | Add Existing Item.OpenReader())) { MessageBox. follow these steps: 1) Right-click the project node in Visual Studio. Windows Server 2008 R2 (Server Core supported with SP1 or later).  C# // get Stream from application resources System. } } } } Requirements Target Platforms: Windows 7.GetType(). // enumerate the entries in the zip file.Reflection.ToLower(). Example The example below loads information from a zip file stored in an embedded resource. To embed a zip file in an application. if (ze. Windows Server 2008 (Server Core not supported).Assembly. Windows Vista SP1 or later. 2) Select a zip file to add to the project as an embedded resource. 3) Select the newly added file and make sure the Build Action property is set to "Embedded Resource".. foreach (C1ZipEntry ze in zip.Assembly a = this.This method allows you to open and work with a zip file stored in a stream instead of in an actual file.txt")) { using (var sr = new StreamReader(ze. Typical usage scenarios for this are zip files stored as application resources or in binary database fields.Open(stream).ReadToEnd(). Windows Server 2003 SP2 See Also Reference .FileName)..

foreach (string fileName in Directory. C1ZipFile opens and closes the zip file automatically whenever entries are added or removed. "*. This can cause delays in systems that have certain types of anti-virus software installed.CloseBatch(). then closes the file:  C# C1ZipFile zip = new C1ZipFile(). adds several entries to it. Use a finally clause to ensure that the CloseBatch method is called even if an exception occurs.Entries.OpenBatch(). try { zip. zip.C1ZipFile Class C1ZipFile Members Overload List OpenBatch Method Example Opens the zip file for multiple operations. Syntax Visual Basic (Declaration) Public Sub OpenBatch() C# public void OpenBatch() Remarks By default.*")) zip. use the OpenBatch and CloseBatch methods to keep the zip file open until the entire operation is concluded.GetFiles(path. Example The code below opens a zip file. } finally { zip. In these cases. or in situations where you want to add a large number of relatively small entries.Add(fileName). } Requirements .Open(myzipfile).

Syntax Visual Basic (Declaration) Public Sub Refresh() C# public void Refresh() Remarks This method is useful in instances where other applications may have changed the zip file and you want to make sure the information in the Entries collection is up to date. Windows Vista SP1 or later. Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members Properties %%scrap%% " --> For a list of all members of this type. Windows XP SP3. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members Refresh Method Refreshes all data members by re-opening the current zip file. .Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 R2 (Server Core supported with SP1 or later). Requirements Target Platforms: Windows 7. Windows XP SP3. Windows Server 2008 (Server Core not supported). see C1ZipFile members.

OverwriteHidden Determines whether the component should overwrite hidden files when extracting entries from the zip file. MemoryThreshold Gets or sets the size of the largest stream to be compressed in memory. UseUtf8Encoding Determines whether file names and comments should be stored in UTF8 format.Public Properties Name Description Comment Gets or sets a comment associated with the current zip file. Top See Also Reference . FileName Gets the name of the current zip file. OverwriteSystem Determines whether the component should overwrite system files when extracting entries from the zip file. Entries Gets a C1ZipEntryCollection that contains the entries in the zip file. TempFileName Gets or sets the name of the temporary file to use when adding entries to the zip file. CompressionLevel Gets or sets the compression level to use when adding entries to the zip file. Password Gets or sets the password to use when adding or retrieving entries from the zip file. OverwriteReadOnly Determines whether the component should overwrite read-only files when extracting entries from the zip file.

Windows XP SP3. Windows Server 2008 (Server Core not supported).} Remarks Higher compression settings create smaller files. .C1ZipFile Class C1. Syntax Visual Basic (Declaration) Public Property Comment As String C# public string Comment {get. Windows Server 2008 R2 (Server Core supported with SP1 or later). Syntax Visual Basic (Declaration) Public Property CompressionLevel As CompressionLevelEnum C# public CompressionLevelEnum CompressionLevel {get. The default setting (CompressionLevelEnum. set. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members CompressionLevel Property Gets or sets the compression level to use when adding entries to the zip file. Windows Vista SP1 or later.C1Zip Namespace Comment Property Gets or sets a comment associated with the current zip file.} Requirements Target Platforms: Windows 7. but take longer to process.DefaultCompression) provides a good trade-off between compression and speed. set.

Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members Entries Property Gets a C1ZipEntryCollection that contains the entries in the zip file.} Remarks The Entries collection is used to enumerate the entries in the zip file. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Requirements Target Platforms: Windows 7. Windows XP SP3.Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. . remove. Syntax Visual Basic (Declaration) Public ReadOnly Property Entries As C1ZipEntryCollection C# public C1ZipEntryCollection Entries {get. and also to add. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). and expand entries. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members FileName Property Gets the name of the current zip file.

Syntax Visual Basic (Declaration) Public Property MemoryThreshold As Integer C# public int MemoryThreshold {get.} Remarks C1ZipFile compresses entries into temporary streams before adding them to the zip file. Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members MemoryThreshold Property Gets or sets the size of the largest stream to be compressed in memory. Windows Server 2008 R2 (Server Core supported with SP1 or later).Syntax Visual Basic (Declaration) Public ReadOnly Property FileName As String C# public string FileName {get. Windows Vista SP1 or later. set. You can control the location of the temporary file using the TempFileName property. Entries with more than MemoryThreshold bytes are compressed using a temporary file. Requirements . Entries with fewer than MemoryThreshold bytes are compressed using a temporary memory stream.} Requirements Target Platforms: Windows 7.

} Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported).Target Platforms: Windows 7. Syntax Visual Basic (Declaration) Public Property OverwriteReadOnly As Boolean . Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Windows XP SP3. Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later). Syntax Visual Basic (Declaration) Public Property OverwriteHidden As Boolean C# public bool OverwriteHidden {get. set. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members OverwriteHidden Property Determines whether the component should overwrite hidden files when extracting entries from the zip file. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members OverwriteReadOnly Property Determines whether the component should overwrite read-only files when extracting entries from the zip file. Windows Vista SP1 or later.

C# public bool OverwriteReadOnly {get. set. Syntax Visual Basic (Declaration) Public Property OverwriteSystem As Boolean C# public bool OverwriteSystem {get. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members OverwriteSystem Property Determines whether the component should overwrite system files when extracting entries from the zip file. . Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members Password Property Properties Methods Events The following tables list the members exposed by C1PrintPreviewControl. Windows XP SP3. Windows Server 2008 (Server Core not supported). set. Windows XP SP3.} Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later).} Requirements Target Platforms: Windows 7. Windows Vista SP1 or later.

Forms.Control) ActiveControl (Inherited from System.Windows.Control) AccessibleRole (Inherited from System.Public Constructors Name Description C1PrintPreviewControl Constructor Initializes a new instance of the C1PrintPreviewControl class.ContainerControl) AllowDrop (Inherited from System. Top Public Properties Name Description AccessibilityObject (Inherited from System.Control) AccessibleDefaultActionDescription (Inherited from System.Control) AccessibleDescription (Inherited from System.Control) AccessibleName (Inherited from System.Forms.Forms.Windows.Forms.Windows.Control) AutoScaleDimensions (Inherited from System.Forms.Forms.Windows.ContainerControl) AutoScrollOffset (Inherited from System.Forms.Windows.Control) AutoScrollPosition (Inherited from .Windows.Windows.Forms.Forms.Windows.Windows.Control) Anchor (Inherited from System.ContainerControl) AutoScaleMode (Inherited from System.Windows.Windows.Forms.Forms.

Windows.Forms.Windows.Control) CanFocus (Inherited from System.Windows.Forms.Windows.Control) Created (Inherited from System.Control) BottomToolStripPanel For internal use.Component) ContainsFocus (Inherited from System.Forms.Forms.Forms.System.Forms.Windows.Forms.Control) ClientSize (Inherited from System.Windows.Control) Capture (Inherited from System. BindingContext (Inherited from System.Forms.ComponentModel.Control) CanSelect (Inherited from System.Windows. BottomToolStripPanelVisible For internal use.Forms.ScrollableControl) AvailablePreviewActions Gets or sets flags indicating which tools should be available in the preview.Windows.Forms.Control) ClientRectangle (Inherited from System.Control) CompanyName (Inherited from System.Forms.Forms.Windows.Forms.Control) ContentPanel For internal use.Windows.Windows.Windows.Windows. Bounds (Inherited from System.Control) . ContextMenu (Inherited from System.Control) Container (Inherited from System.ContainerControl) Bottom (Inherited from System.

ContainerControl) DataBindings (Inherited from System.Windows.Control) Dock (Inherited from System.Windows.Forms.Windows.Control) .Control) ExportOptions Gets options controlling the behavior of export modules.Windows.Windows.Windows. Focused (Inherited from System.ScrollableControl) ImageSet Gets or sets a value indicating which set of predefined images is used by the preview.Windows.Forms.Control) Height (Inherited from System.Forms.Control) InvokeRequired (Inherited from System.Forms.Forms.Forms.Windows.Forms.Control) HorizontalScroll (Inherited from System.Control) DisplayRectangle (Inherited from System.Control) Handle (Inherited from System.Forms.CurrentAutoScaleDimensions (Inherited from System.Forms. ImeMode (Inherited from System.Windows.Control) HasChildren (Inherited from System.Control) Font (Inherited from System.Windows.ScrollableControl) Disposing (Inherited from System.Windows.Control) Document Gets or sets the document shown by the preview.Windows.Windows.Forms.Forms. Enabled (Inherited from System.Forms.Forms.Windows.Forms.

Forms.Forms.Windows. Location (Inherited from System.Forms.Windows.Windows.IsAccessible (Inherited from System.Forms.Windows.ContainerControl) .Forms.Windows. LeftToolStripPanelVisible For internal use.Forms.Forms. Padding (Inherited from System.Control) Left (Inherited from System. OutlineViewCaption Gets or sets the outline view caption.Windows.Forms.Windows.Forms.Windows.Forms.Forms.Control) IsDisposed (Inherited from System.Control) IsHandleCreated (Inherited from System.Forms.Windows.Windows.Forms.Control) IsMirrored (Inherited from System.Control) LeftToolStripPanel For internal use.Windows.Control) MinimumSize (Inherited from System.Windows.Control) LayoutEngine (Inherited from System.Control) ParentForm (Inherited from System.Windows.Forms.Windows.Control) Name (Inherited from System.Control) NavigationPanelVisible Gets or sets a value indicating whether the navigation panel should be visible in the preview.Control) MaximumSize (Inherited from System.Control) Margin (Inherited from System.Control) Parent (Inherited from System.

PreviewStatusText Gets the preview status. PreviewTextSearchPanel Gets the preview text search panel.Control) Size (Inherited from System.Forms.Forms. RightToolStripPanelVisible For internal use.Windows.Control) RightToolStripPanel For internal use.Control) .Windows.Control) Region (Inherited from System. Site (Inherited from System. PreviewProgressBar Gets the preview progress bar.Windows.Windows.Windows.Control) Right (Inherited from System.Windows.Forms.Control) PreviewNavigationPanel Gets the preview navigation panel. PreviewStatusBar Gets the preview status bar.Forms.Control) RecreatingHandle (Inherited from System.Control) RightToLeft (Inherited from System. PreviewThumbnailView Gets the preview thumbnails view.Windows.Forms.Forms.PreferredSize (Inherited from System.Windows.Control) ProductVersion (Inherited from System.Forms.Forms. PreviewOutlineView Gets the preview outline view.Forms. PreviewPane Gets the preview pane.Windows. ProductName (Inherited from System.

Forms.Control) TextSearchPanelVisible Gets or sets a value indicating whether the text search panel should be visible in the preview.Control) TopToolStripPanel For internal use.Forms. ToolBars Gets the preview control toolbars.Control) VerticalScroll (Inherited from System.Windows.Windows. TabIndex (Inherited from System. ThumbnailViewCaption Gets or sets the thumbnail view caption.Forms. StatusBarVisible Gets or sets a value indicating whether the status bar should be visible in the preview.Forms. UseWaitCursor (Inherited from System. Top (Inherited from System.Windows.Control) Tag (Inherited from System.Forms.Control) .Windows.Windows.SsrsPaginated Gets or sets whether an SSRS report should appear in paginated mode (for printing) or in RPL mode (interactive).Windows.Control) Text (Inherited from System.Forms.Windows.Windows. TextSearchUIStyle Gets or sets the type of UI used for text search.Control) TabStop (Inherited from System. TopToolStripPanelVisible For internal use.Forms.ScrollableControl) Visible (Inherited from System.Forms.Forms.Control) TopLevelControl (Inherited from System.Windows.

Forms.Forms.Windows.Windows.Control) FindForm (Inherited from System.Width (Inherited from System.Forms.MarshalByRefObject) Dispose (Inherited from System.Forms.Control) GetChildAtPoint Overloaded.Windows.Windows.Control) GetLifetimeService (Inherited from System.Control) Top Public Methods Name Description BeginInvoke Overloaded.Control) CreateObjRef (Inherited from System.Windows.Windows. (Inherited from System.Control) DrawToBitmap (Inherited from System.Control) CreateGraphics (Inherited from System.Windows.Windows.Forms.Forms.Windows.MarshalByRefObject) GetNextControl (Inherited from System.Control) Contains (Inherited from System.Forms.Forms.Windows.Forms.Control) GetContainerControl (Inherited from System.Windows.ComponentModel.Forms.Control) BringToFront (Inherited from System.Control) CreateControl (Inherited from System. (Inherited from System.Windows.Windows.Control) Focus (Inherited from System.Forms.Control) .Forms.Windows.Forms.Forms.Control) EndInvoke (Inherited from System.Component) DoDragDrop (Inherited from System.

Forms.Windows.Control) PreProcessControlMessage (Inherited from System.GetPreferredSize (Inherited from System.MarshalByRefObject) Invalidate Overloaded.Windows.Control) ResumeLayout Overloaded.Forms.Windows.Forms.Forms.Forms.ContainerControl) PerformLayout Overloaded. (Inherited from System.Forms.Windows.Forms.Control) RectangleToClient (Inherited from System.Forms.Control) InitializeLifetimeService (Inherited from System.Control) Hide (Inherited from System.Forms.Windows. (Inherited from System.Windows.Control) ResetText (Inherited from System.Control) Refresh (Inherited from System.Windows.Windows.Control) PointToScreen (Inherited from System.Control) Invoke Overloaded.Control) PreProcessMessage (Inherited from System.Forms.Control) PerformAutoScale (Inherited from System.Windows.Control) RectangleToScreen (Inherited from System.Control) Scale (Inherited from System.Windows.Control) . (Inherited from System.Forms.Windows.Windows.Control) PointToClient (Inherited from System.Forms. (Inherited from System.Forms.Windows.Windows.Windows.Forms.Forms.Windows.ScrollableControl) Select (Inherited from System.Windows.Windows.Forms.Forms.Forms.Control) ScrollControlIntoView (Inherited from System.

Control) SetAutoScrollMargin (Inherited from System.Forms.Forms.SelectNextControl (Inherited from System.Windows.Windows.Windows.Control) ControlAdded (Inherited from System.Forms.Windows.Control) ChangeUICues (Inherited from System.Control) ToString (Inherited from System.Control) ClientSizeChanged (Inherited from System. (Inherited from System.Forms.Windows.Forms.Windows.Windows.Windows.ComponentModel.Forms.Forms.ContainerControl) Top Public Events Name Description BindingContextChanged (Inherited from System.Windows.Windows.Forms.Control) SuspendLayout (Inherited from System.Forms. (Inherited from System.Windows.Windows.Windows.Control) ControlRemoved (Inherited from System.ScrollableControl) SetBounds Overloaded.Component) Update (Inherited from System.Control) Click (Inherited from System.Control) .Forms.Forms.Windows.Windows.Forms.Control) Validate Overloaded.Forms.Forms.Control) ContextMenuChanged (Inherited from System.Control) Show (Inherited from System.Forms.Control) SendToBack (Inherited from System.

Control) FontChanged (Inherited from System.Control) Invalidated (Inherited from System.Control) .Windows.Forms.Forms.Forms.Control) HelpRequested (Inherited from System.Windows.Windows.Forms.ComponentModel.Forms.Control) Enter (Inherited from System.Forms.Windows.Forms.Windows.Windows.Component) DockChanged (Inherited from System.Control) EnabledChanged (Inherited from System.Control) KeyDown (Inherited from System.Windows.Control) ImeModeChanged (Inherited from System.Forms.Windows.Forms.Forms.Forms.Forms.Windows.Control) DragDrop (Inherited from System.Windows.Windows.Windows.Forms.Windows.Control) DragEnter (Inherited from System.Windows.Control) GotFocus (Inherited from System.Disposed (Inherited from System.Control) GiveFeedback (Inherited from System.Windows.Forms.Control) KeyPress (Inherited from System.Control) DoubleClick (Inherited from System.Forms.Windows.Control) HandleDestroyed (Inherited from System.Forms.Windows.Forms.Forms.Control) DragLeave (Inherited from System.Control) HandleCreated (Inherited from System.Windows.Control) DragOver (Inherited from System.

Forms.Windows.Windows.Windows.Forms.Windows.Control) MarginChanged (Inherited from System.Forms.Forms.Windows.Control) LostFocus (Inherited from System.Windows.Windows.Windows.Control) MouseWheel (Inherited from System.Forms.Windows.Forms.Control) MouseEnter (Inherited from System.Control) MouseHover (Inherited from System.Forms.Windows.Control) MouseDoubleClick (Inherited from System.Control) Move (Inherited from System.Control) Paint (Inherited from System.Forms.Windows.Control) MouseClick (Inherited from System.Windows.Forms.Control) Leave (Inherited from System.Control) MouseUp (Inherited from System.Forms.Forms.Forms.Windows.KeyUp (Inherited from System.Forms.Control) MouseDown (Inherited from System.Windows.Windows.Forms.Windows.Control) LocationChanged (Inherited from System.Control) .Forms.Control) MouseCaptureChanged (Inherited from System.Forms.Forms.Windows.Control) Layout (Inherited from System.Control) MouseMove (Inherited from System.Windows.Control) PaddingChanged (Inherited from System.Control) MouseLeave (Inherited from System.Forms.Windows.Forms.

Control) QueryAccessibilityHelp (Inherited from System.Windows.Forms.Windows.Control) TabIndexChanged (Inherited from System.Forms.Control) PreviewKeyDown (Inherited from System.Windows.Forms.Windows.Windows.Windows.Forms.ParentChanged (Inherited from System.Forms.Forms.Control) Validating (Inherited from System.Control) TabStopChanged (Inherited from System.Windows.Control) Top See Also Reference .Forms.Windows.Control) TextChanged (Inherited from System.Control) StyleChanged (Inherited from System.Control) QueryContinueDrag (Inherited from System.Forms.Windows.ScrollableControl) SizeChanged (Inherited from System.Control) Validated (Inherited from System.Windows.Control) Scroll (Inherited from System.Forms.Control) VisibleChanged (Inherited from System.Forms.Control) SystemColorsChanged (Inherited from System.Control) RegionChanged (Inherited from System.Forms.Forms.Forms.Windows.Forms.Windows.Control) RightToLeftChanged (Inherited from System.Windows.Windows.Forms.Windows.Forms.Windows.Forms.Windows.Control) Resize (Inherited from System.

Syntax Visual Basic (Declaration) Public Property TempFileName As String C# public string TempFileName {get.Path. C1ZipFile you can control its location by setting the TempFileName property. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members UseUtf8Encoding Property Determines whether file names and comments should be stored in UTF8 format. C1ZipFile will create one automatically using the System.C1PrintPreviewControl Class C1.C1Preview Namespace TempFileName Property Gets or sets the name of the temporary file to use when adding entries to the zip file.GetTempFileName method.} Remarks C1ZipFile creates temporary streams while adding entries to a zip file.IO. These temporary streams can be memory-based or disk-based. set. If a temporary file is used.Win. Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. If you don't select a path for the temporary file. Windows XP SP3. depending on the size of the entry and on the setting of the MemoryThreshold property. Syntax Visual Basic (Declaration) Public Property UseUtf8Encoding As Boolean .

Windows Vista SP1 or later. Because of this. The caveat is that Unicode file names may not be read correctly by other zip utilities. Windows XP SP3. but those file names and comments may not be read correctly by other utilities. Windows Server 2003 SP2 See Also Reference C1ZipFile Class C1ZipFile Members Events %%scrap%% " --> For a list of all members of this type. some zip utilities will not allow storing file names or comments with Unicode characters. which allows Unicode characters.} Remarks The Zip specification does not specify what character encoding to be used for the embedded file names and comments. The original IBM PC character encoding set.C# public bool UseUtf8Encoding {get. Requirements Target Platforms: Windows 7. is supposed to be the only encoding supported. commonly referred to as IBM Code Page 437. Windows Server 2008 R2 (Server Core supported with SP1 or later). Top See Also Reference . Others do allow it. set. Windows Server 2008 (Server Core not supported). Public Events Name Description Progress Fired while data is being read from or written into a zip file. see C1ZipFile members. Setting the UseUtf8Encoding to true causes C1Zip to store and retrieve file names and comments using the Utf8 encoding.

Windows XP SP3.C1ZipFile Class C1.NET streams. Syntax Visual Basic (Declaration) Public Shadows Property BottomToolStripPanelVisible As System.Boolean C# public new System.Stream C# . Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference C1PrintPreviewControl Class C1PrintPreviewControl Members C1ZStreamReader Example Decompresses data from . Windows Server 2008 R2 (Server Core supported with SP1 or later).bool BottomToolStripPanelVisible {get.C1Zip Namespace Progress Event For internal use. Windows Server 2008 (Server Core not supported).IO. set. Object Model Syntax Visual Basic (Declaration) Public Class C1ZStreamReader Inherits System.} Requirements Target Platforms: Windows 7.

Stream C1.MarshalByRefObject System.IO. Windows Vista SP1 or later.public class C1ZStreamReader : System. or create a System. // attach decompressor stream to memory stream var sr = new C1ZStreamReader(ms).Stream Remarks To decompress data from a compressed stream.Object System. return reader. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Members C1.C1Zip. } Inheritance Hierarchy System. // read uncompressed data var reader = new StreamReader(sr).StreamReader on the C1ZStreamReader. Windows Server 2008 R2 (Server Core supported with SP1 or later). Example The code below decompresses a string that was stored into a memory stream object:  C# public string ExpandString(byte[] buffer) { // turn buffer into a memory stream var ms = new MemoryStream(buffer). Then read the data from the C1ZStreamReader using the Read method.C1Zip Namespace .ReadToEnd().IO. The second option is indicated when you want to read formatted data. Windows XP SP3.IO. create a C1ZStreamReader object passing the compressed stream to the C1ZStreamReader constructor.C1ZStreamReader Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported).

// read uncompressed data var reader = new StreamReader(sr).Overview Example Decompresses data from .IO.IO. or create a System. create a C1ZStreamReader object passing the compressed stream to the C1ZStreamReader constructor. Object Model Syntax Visual Basic (Declaration) Public Class C1ZStreamReader Inherits System. // attach decompressor stream to memory stream var sr = new C1ZStreamReader(ms).Stream Remarks To decompress data from a compressed stream.StreamReader on the C1ZStreamReader.ReadToEnd(). The second option is indicated when you want to read formatted data. Then read the data from the C1ZStreamReader using the Read method. Example The code below decompresses a string that was stored into a memory stream object:  C# public string ExpandString(byte[] buffer) { // turn buffer into a memory stream var ms = new MemoryStream(buffer). return reader. } Inheritance Hierarchy .IO.Stream C# public class C1ZStreamReader : System.NET streams.

MarshalByRefObject System. Windows XP SP3.System.Object System. CanSeek Overridden. Windows Server 2008 (Server Core not supported).IO.C1ZStreamReader Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Members C1. CanRead Overridden.C1Zip. Windows Server 2008 R2 (Server Core supported with SP1 or later).Stream C1. CanTimeout (Inherited from System. Always returns True. Windows Vista SP1 or later. Always returns False.C1Zip Namespace Members Properties Methods The following tables list the members exposed by C1ZStreamReader.IO. Public Constructors Name Description C1ZStreamReader Constructor Overloaded.Stream) . Top Public Properties Name Description BaseStream Gets the underlying stream that contains the compressed data.

CanWrite Overridden. SizeUncompressed Gets the number of bytes that were compressed into the stream (uncompressed bytes). OwnsBaseStream Gets or sets whether calling the Close method will also close the underlying stream (see BaseStream).Stream) Close Overridden.IO.IO.Stream) BeginWrite (Inherited from System. Length Overridden.Stream) ZStream Gets the ZStream instance wrapped by this C1ZStreamWriter.Stream) SizeCompressed Gets the number of bytes in the stream (compressed bytes). Closes the current stream compressor and flushed any pending .IO. ReadTimeout (Inherited from System. Top Public Methods Name Description BeginRead (Inherited from System. WriteTimeout (Inherited from System. SizeCompressedLong Gets the number of bytes in the stream (compressed bytes). SizeUncompressedLong Gets the number of bytes that were compressed into the stream (uncompressed bytes). Position Overridden. Gets the length of the compressed stream if it is known (or -1 if the length of the compressed stream is unknown).IO. Always returns False. Gets the position within the stream (read-only).

IO. (Inherited from System.Stream) EndWrite (Inherited from System.Stream) GetLifetimeService (Inherited from System.Stream) CreateObjRef (Inherited from System. CopyTo Overloaded.IO.Stream) EndRead (Inherited from System.MarshalByRefObject) InitializeLifetimeService (Inherited from System.IO. Reads a sequence of bytes from the underlying compressed stream.IO.data into the base stream. then advances the position within the stream by the number of bytes read. decompressing them into a buffer. Clears all buffers for this stream and causes any buffered data to be written to the underlying stream.MarshalByRefObject) Dispose (Inherited from System. (Inherited from System. (Inherited from System.Stream) ReadByte Overridden.Stream) CopyToAsync Overloaded. (Inherited from System. FlushAsync Overloaded. If the OwnsBaseStream property is set to True (the default value). Reads a byte from the stream and advances the position within the stream by one byte. ReadAsync Overloaded.IO.IO. then this method also closes the base stream and releases any resources (such as sockets and file handles) associated with it.Stream) Flush Overridden.IO. or returns -1 if at the end .MarshalByRefObject) Read Overridden.

C1Zip Namespace C1ZStreamReader Constructor Overload List Overload Description C1ZStreamReader Constructor(Stream) Initializes a new instance of the C1ZStreamReader class. SetLength Overridden. WriteAsync Overloaded. Seek Overridden. (Inherited from System.Boolean) Initializes a new instance of the C1ZStreamReader class.IO. Write Overridden. Not supported. C1ZStreamReader Constructor(Stream. C1ZStreamReader Constructor(Stream. C1ZStreamReader Constructor(Stream. Sets the number of compressed bytes to read from the underlying stream.IO.Boolean.of the stream.Boolean) Initializes a new instance of the C1ZStreamReader class.Stream) Top See Also Reference C1ZStreamReader Class C1.Stream) WriteByte (Inherited from System.Int32) Initializes a new instance of the C1ZStreamReader class.Boolean. . This method is overridden and is not supported by the C1ZStreamReader class.

Requirements Target Platforms: Windows 7.Int64.Boolean.C1ZStreamReader Constructor(Stream. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members C1ZStreamReader Constructor(Stream) Input stream that contains the compressed data. Windows Vista SP1 or later.Int32) Initializes a new instance of the C1ZStreamReader class. Syntax Visual Basic (Declaration) Public Function New( _ ByVal baseStream As Stream _ ) C# public C1ZStreamReader( Stream baseStream ) Parameters baseStream Input stream that contains the compressed data.Boolean. Windows XP SP3. C1ZStreamReader Constructor(Stream. Initializes a new instance of the C1ZStreamReader class. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported).Int32. Requirements .Int32) Initializes a new instance of the C1ZStreamReader class.

Int32) Input stream that contains the compressed data. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members Overload List C1ZStreamReader Constructor(Stream. Windows Server 2008 (Server Core not supported).Boolean. Initializes a new instance of the C1ZStreamReader class. Specifies whether the compressed stream was created in zip format. Windows XP SP3. _ ByVal sizeCompressed As Integer _ ) C# public C1ZStreamReader( Stream baseStream. int sizeCompressed ) Parameters baseStream Input stream that contains the compressed data. Specifies the number of compressed bytes to read from the stream. zip Specifies whether the compressed stream was created in zip format. . _ ByVal zip As Boolean.Target Platforms: Windows 7. bool zip. Syntax Visual Basic (Declaration) Public Function New( _ ByVal baseStream As Stream. Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later).

Syntax Visual Basic (Declaration) Public Function New( _ ByVal baseStream As Stream. Initializes a new instance of the C1ZStreamReader class. Windows Server 2008 (Server Core not supported).Boolean) Input stream that contains the compressed data. If this parameter is not specified. it is assumed that the stream contains a single stream of compressed data. Windows Server 2008 R2 (Server Core supported with SP1 or later). Specifies whether the compressed stream was created in zip format. _ ByVal zip As Boolean _ ) C# public C1ZStreamReader( Stream baseStream. Remarks The sizeCompressed parameter is needed only when a single stream contains several compressed streams (in zip files for example). bool zip ) .sizeCompressed Specifies the number of compressed bytes to read from the stream. Requirements Target Platforms: Windows 7. Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members Overload List C1ZStreamReader Constructor(Stream. Windows Vista SP1 or later.

Syntax Visual Basic (Declaration) Public Function New( _ ByVal baseStream As Stream. Initializes a new instance of the C1ZStreamReader class. _ ByVal header As Boolean. Windows Server 2008 R2 (Server Core supported with SP1 or later). _ ByVal crc32 As Boolean _ ) C# public C1ZStreamReader( . zip Specifies whether the compressed stream was created in zip format. Specifies whether the compressed stream contains header information (should be False for streams in zip files).Boolean) Input stream that contains the compressed data. Windows Server 2008 (Server Core not supported).Boolean. Specifies whether the compressed stream contains a CRC32 checksum (should be True for streams in zip files). Windows XP SP3. Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members Overload List C1ZStreamReader Constructor(Stream. Windows Vista SP1 or later.Parameters baseStream Input stream that contains the compressed data.

bool header. Windows XP SP3. crc32 Specifies whether the compressed stream contains a CRC32 checksum (should be True for streams in zip files).Boolean.Int32. header Specifies whether the compressed stream contains header information (should be False for streams in zip files). Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members Overload List C1ZStreamReader Constructor(Stream. bool crc32 ) Parameters baseStream Input stream that contains the compressed data.Stream baseStream. Initializes a new instance of the C1ZStreamReader class. Syntax Visual Basic (Declaration) . Specifies the number of compressed bytes to read from the stream. Specifies the method that was used to compress the stream. Specifies whether the compressed stream was created in zip format.Int32) Input stream that contains the compressed data. Windows Vista SP1 or later.

Windows Server 2008 R2 (Server Core supported with SP1 or later). _ ByVal method As Integer _ ) C# public C1ZStreamReader( Stream baseStream. Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. int sizeCompressed. method Specifies the method that was used to compress the stream. _ ByVal sizeCompressed As Integer. Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members Overload List . int method ) Parameters baseStream Input stream that contains the compressed data. _ ByVal zip As Boolean. sizeCompressed Specifies the number of compressed bytes to read from the stream.Public Function New( _ ByVal baseStream As Stream. zip Specifies whether the compressed stream was created in zip format. bool zip. Windows Server 2008 (Server Core not supported).

method Specifies the method that was used to compress the stream. _ ByVal zip As Boolean. int method ) Parameters baseStream Input stream that contains the compressed data. long sizeCompressed. _ ByVal sizeCompressed As Long. _ ByVal method As Integer _ ) C# public C1ZStreamReader( Stream baseStream. Syntax Visual Basic (Declaration) Public Function New( _ ByVal baseStream As Stream.Int32) Input stream that contains the compressed data. Specifies whether the compressed stream was created in zip format.C1ZStreamReader Constructor(Stream.Int64. sizeCompressed Specifies the number of compressed bytes to read from the stream. Specifies the number of compressed bytes to read from the stream. Initializes a new instance of the C1ZStreamReader class. zip Specifies whether the compressed stream was created in zip format. . bool zip.Boolean. Specifies the method that was used to compress the stream.

(Inherited from System.IO.IO. Windows Server 2008 R2 (Server Core supported with SP1 or later).IO.IO. Windows XP SP3. then this method also closes the base stream and releases any resources (such as sockets and file handles) associated with it. Windows Vista SP1 or later.Stream) BeginWrite (Inherited from System. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members Overload List Methods > Name Description BeginRead (Inherited from System.IO. Windows Server 2008 (Server Core not supported).Requirements Target Platforms: Windows 7.MarshalByRefObject) Dispose (Inherited from System. Closes the current stream compressor and flushed any pending data into the base stream.Stream) .Stream) EndRead (Inherited from System. CopyTo Overloaded.Stream) EndWrite (Inherited from System.Stream) Overridden.IO. (Inherited from System.Stream) CreateObjRef (Inherited from System.IO. Close If the OwnsBaseStream property is set to True (the default value).Stream) CopyToAsync Overloaded.

This method is overridden and is not supported by the C1ZStreamReader class. If the OwnsBaseStream property is set to True (the default value).IO.Stream) GetLifetimeService (Inherited from System. Syntax .Stream) Overridden. FlushAsync Overloaded. WriteAsync Overloaded.IO. ReadAsync Overloaded. Sets the number of compressed bytes to read from the underlying stream. Clears all buffers for this stream and causes any buffered data to be written to the underlying stream.C1Zip Namespace Close Method Closes the current stream compressor and flushed any pending data into the base stream. (Inherited from System. or returns -1 if at the end of the stream.IO. Reads a byte from the stream and advances the position ReadByte within the stream by one byte.Stream) Top See Also Reference C1ZStreamReader Class C1. Reads a sequence of bytes from the underlying Read compressed stream. decompressing them into a buffer.MarshalByRefObject) Overridden. Seek SetLength Write Overridden.IO. then this method also closes the base stream and releases any resources (such as sockets and file handles) associated with it. Not supported. Overridden. (Inherited from System.Flush Overridden. then advances the position within the stream by the number of bytes read. (Inherited from System. Overridden.MarshalByRefObject) InitializeLifetimeService (Inherited from System.Stream) WriteByte (Inherited from System.

Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members . Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 R2 (Server Core supported with SP1 or later). Syntax Visual Basic (Declaration) Public Overrides Sub Flush() C# public override void Flush() Requirements Target Platforms: Windows 7.Visual Basic (Declaration) Public Overrides Sub Close() C# public override void Close() Requirements Target Platforms: Windows 7. Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members Flush Method Clears all buffers for this stream and causes any buffered data to be written to the underlying stream. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows XP SP3.

offset The zero-based byte offset in buf at which to begin storing the data read from the current stream. The maximum number of (decompressed) bytes to be read from the current stream. Return Value . buf contains the specified byte array with the values between offsetand (offset + count) replaced by the uncompressed data read from the stream. then advances the position within the stream by the number of bytes read. _ ByVal count As Integer _ ) As Integer C# public override int Read( byte[] buf. decompressing them into a buffer. count The maximum number of (decompressed) bytes to be read from the current stream. The zero-based byte offset in buf at which to begin storing the data read from the current stream. When this method returns. Reads a sequence of bytes from the underlying compressed stream. When this method returns. int count ) Parameters buf An array of bytes. int offset. _ ByVal offset As Integer.Read Method An array of bytes. Syntax Visual Basic (Declaration) Public Overrides Function Read( _ ByVal buf() As Byte. buf contains the specified byte array with the values between offsetand (offset + count) replaced by the uncompressed data read from the stream.

Windows Server 2008 (Server Core not supported). This may be less than the number of bytes requested if that many bytes are not currently available. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members . Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later). or zero (0) if the end of the stream has been reached. Windows Server 2008 (Server Core not supported).The total number of bytes read into the buffer. or -1 if at the end of the stream. Syntax Visual Basic (Declaration) Public Overrides Function ReadByte() As Integer C# public override int ReadByte() Return Value The unsigned byte cast to an System. Windows Vista SP1 or later. or returns -1 if at the end of the stream. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members ReadByte Method Reads a byte from the stream and advances the position within the stream by one byte.Int32. Windows XP SP3. Requirements Target Platforms: Windows 7. Requirements Target Platforms: Windows 7.

Syntax Visual Basic (Declaration) Public Overrides Function Seek( _ ByVal offset As Long.Seek Method Not supported. _ ByVal origin As SeekOrigin _ ) As Long C# public override long Seek( long offset. Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public Overrides Sub SetLength( _ . Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members SetLength Method Sets the number of compressed bytes to read from the underlying stream. SeekOrigin origin ) Parameters offset origin Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Windows XP SP3.

int count ) . _ ByVal offset As Integer. int offset. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members Write Method This method is overridden and is not supported by the C1ZStreamReader class.ByVal value As Long _ ) C# public override void SetLength( long value ) Parameters value Requirements Target Platforms: Windows 7. Windows XP SP3. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Syntax Visual Basic (Declaration) Public Overrides Sub Write( _ ByVal buf() As Byte. _ ByVal count As Integer _ ) C# public override void Write( byte[] buf. Windows Server 2008 R2 (Server Core supported with SP1 or later).

CanTimeout (Inherited from System.Stream) CanWrite Overridden. Windows Vista SP1 or later. Always returns False. Always returns False. see C1ZStreamReader members.Parameters buf offset count Requirements Target Platforms: Windows 7. Gets the length of the compressed stream if it is known (or -1 if the length of the compressed stream is . Always returns True. CanSeek Overridden.IO. Length Overridden. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Public Properties Name Description BaseStream Gets the underlying stream that contains the compressed data. Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members Properties %%scrap%% " --> For a list of all members of this type. CanRead Overridden.

IO.Stream) SizeCompressed Gets the number of bytes in the stream (compressed bytes). Syntax Visual Basic (Declaration) Public ReadOnly Property BaseStream As Stream . Gets the position within the stream (read-only). SizeCompressedLong Gets the number of bytes in the stream (compressed bytes). ReadTimeout (Inherited from System. WriteTimeout (Inherited from System. SizeUncompressed Gets the number of bytes that were compressed into the stream (uncompressed bytes). OwnsBaseStream Gets or sets whether calling the Close method will also close the underlying stream (see BaseStream).unknown).C1Zip Namespace BaseStream Property Gets the underlying stream that contains the compressed data. Position Overridden.Stream) ZStream Gets the ZStream instance wrapped by this C1ZStreamWriter.IO. Top See Also Reference C1ZStreamReader Class C1. SizeUncompressedLong Gets the number of bytes that were compressed into the stream (uncompressed bytes).

} Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Syntax . Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members CanRead Property Always returns True. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members CanSeek Property Always returns False. Syntax Visual Basic (Declaration) Public Overrides ReadOnly Property CanRead As Boolean C# public override bool CanRead {get. Windows XP SP3.} Requirements Target Platforms: Windows 7. Windows XP SP3. Windows Vista SP1 or later.C# public Stream BaseStream {get. Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later).

Windows Server 2008 R2 (Server Core supported with SP1 or later). Syntax Visual Basic (Declaration) Public Overrides ReadOnly Property CanWrite As Boolean C# public override bool CanWrite {get.Visual Basic (Declaration) Public Overrides ReadOnly Property CanSeek As Boolean C# public override bool CanSeek {get. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members CanWrite Property Always returns False.} Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Windows Vista SP1 or later.} Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members . Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. Windows XP SP3.

Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members OwnsBaseStream Property Gets or sets whether calling the Close method will also close the underlying stream (see BaseStream). Syntax Visual Basic (Declaration) Public Overrides ReadOnly Property Length As Long C# public override long Length {get. Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later).} Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 . Windows Server 2008 R2 (Server Core supported with SP1 or later). set. Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows XP SP3. Syntax Visual Basic (Declaration) Public Property OwnsBaseStream As Boolean C# public bool OwnsBaseStream {get. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported).} Requirements Target Platforms: Windows 7.Length Property Gets the length of the compressed stream if it is known (or -1 if the length of the compressed stream is unknown).

See Also Reference C1ZStreamReader Class C1ZStreamReader Members Position Property Gets the position within the stream (read-only).} Requirements . Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later).} Requirements Target Platforms: Windows 7. Syntax Visual Basic (Declaration) Public ReadOnly Property SizeCompressed As Integer C# public int SizeCompressed {get. Syntax Visual Basic (Declaration) Public Overrides Property Position As Long C# public override long Position {get. Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members SizeCompressed Property Gets the number of bytes in the stream (compressed bytes). set.

Syntax Visual Basic (Declaration) Public ReadOnly Property SizeUncompressed As Integer . Windows XP SP3. Windows Vista SP1 or later. Windows Vista SP1 or later.} Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members SizeUncompressed Property Gets the number of bytes that were compressed into the stream (uncompressed bytes). Syntax Visual Basic (Declaration) Public ReadOnly Property SizeCompressedLong As Long C# public long SizeCompressedLong {get. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Windows XP SP3.Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members SizeCompressedLong Property Gets the number of bytes in the stream (compressed bytes).

Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members SizeUncompressedLong Property Gets the number of bytes that were compressed into the stream (uncompressed bytes). Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members ZStream Property Gets the ZStream instance wrapped by this C1ZStreamWriter. Windows XP SP3. Syntax . Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public ReadOnly Property SizeUncompressedLong As Long C# public long SizeUncompressedLong {get.} Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported).C# public int SizeUncompressed {get. Windows Server 2008 (Server Core not supported).} Requirements Target Platforms: Windows 7.

Windows Server 2008 R2 (Server Core supported with SP1 or later).Stream Remarks .} Remarks This property is useful only in advanced applications that need to customize the low-level behavior of the compressor.IO.IO. Object Model Syntax Visual Basic (Declaration) Public Class C1ZStreamWriter Inherits System. Windows XP SP3.NET Streams. Windows Server 2008 (Server Core not supported). It is not needed in common applications. Windows Vista SP1 or later.Stream C# public class C1ZStreamWriter : System. Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZStreamReader Class C1ZStreamReader Members C1ZStreamWriter Example Compresses data into .Visual Basic (Declaration) Public ReadOnly Property ZStream As ZStream C# public ZStream ZStream {get.

Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). // write data into compressor stream var writer = new StreamWriter(sw). Windows Server 2003 SP2 See Also Reference .Flush(). The second option is indicated when you want to write formatted data.Stream C1.ToArray(). or create a System.MarshalByRefObject System.C1Zip. // return the memory buffer return ms. create a C1ZStreamWriter object passing the stream to the C1ZStreamWriter constructor. Windows XP SP3. call the Close method to flush the data and close the underlying stream. When you are done writing the data.Object System.C1ZStreamWriter Requirements Target Platforms: Windows 7. Example The code below compresses a string into a memory stream:  C# public byte[] CompressString(string str) { // open memory stream var ms = new MemoryStream(). Then write the data into the C1ZStreamWriter using the Write method.Write(str).To compress data into a stream. writer. // flush any pending data writer.IO. Windows Server 2008 R2 (Server Core supported with SP1 or later). // attach compressor stream to memory stream var sw = new C1ZStreamWriter(ms).StreamWriter on the C1ZStreamWriter. } Inheritance Hierarchy System.IO.

Stream C# public class C1ZStreamWriter : System. When you are done writing the data. call the Close method to flush the data and close the underlying stream.IO.C1Zip Namespace Overview Example Compresses data into .Stream Remarks To compress data into a stream.IO.IO. Then write the data into the C1ZStreamWriter using the Write method. The second option is indicated when you want to write formatted data. create a C1ZStreamWriter object passing the stream to the C1ZStreamWriter constructor. or create a System. .C1ZStreamWriter Members C1.StreamWriter on the C1ZStreamWriter.NET Streams. Object Model Syntax Visual Basic (Declaration) Public Class C1ZStreamWriter Inherits System. Example The code below compresses a string into a memory stream:  C# public byte[] CompressString(string str) { // open memory stream var ms = new MemoryStream(). // attach compressor stream to memory stream var sw = new C1ZStreamWriter(ms).

Windows Server 2008 (Server Core not supported). Public Constructors Name Description C1ZStreamWriter Constructor Overloaded. Windows XP SP3.C1Zip. // flush any pending data writer. } Inheritance Hierarchy System.C1ZStreamWriter Requirements Target Platforms: Windows 7.ToArray().IO.Object System. Windows Vista SP1 or later.MarshalByRefObject System. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Members C1. // return the memory buffer return ms. Windows Server 2008 R2 (Server Core supported with SP1 or later).C1Zip Namespace Members Properties Methods The following tables list the members exposed by C1ZStreamWriter. writer. Top Public Properties Name Description .Write(str).Flush().// write data into compressor stream var writer = new StreamWriter(sw).Stream C1.

SizeUncompressed Gets the number of bytes that were compressed into the stream (uncompressed bytes). Position Overridden. Always returns True. CanTimeout (Inherited from System.IO. Checksum Gets the checksum value used to check the integrity of the stream. . Top WriteTimeout (Inherited from System. OwnsBaseStream Gets or sets whether calling the Close method will also close the underlying stream (see BaseStream).Stream) ZStream Gets the ZStream instance wrapped by this C1ZStreamWriter.Stream) SizeCompressed Gets the number of bytes in the stream (compressed bytes). Gets the position within the stream (read-only).Stream) CanWrite Overridden. in bytes.IO. Returns the length of the underlying stream. Always returns False. Length Overridden. Always returns False. ReadTimeout (Inherited from System. CanRead Overridden. SizeCompressedLong Gets the number of bytes in the stream (compressed bytes). CanSeek Overridden.BaseStream Gets the underlying stream that receives the compressed data.IO. SizeUncompressedLong Gets the number of bytes that were compressed into the stream (uncompressed bytes).

If the OwnsBaseStream property is set to True (the default value). FlushAsync Overloaded.MarshalByRefObject) .IO.Stream) CreateObjRef (Inherited from System.MarshalByRefObject) Dispose (Inherited from System. then this method also closes the base stream and releases any resources (such as sockets and file handles) associated with it.IO.IO.IO. (Inherited from System.Stream) Flush Overridden.Stream) Close Overridden.IO.Public Methods Name Description BeginRead (Inherited from System.MarshalByRefObject) InitializeLifetimeService (Inherited from System. CopyTo Overloaded. (Inherited from System.Stream) EndRead (Inherited from System.IO. (Inherited from System. Closes the current stream compressor and flushed any pending data into the base stream.Stream) EndWrite (Inherited from System.IO.Stream) BeginWrite (Inherited from System. Clears all buffers for this stream and causes any buffered data to be written to the underlying stream.Stream) CopyToAsync Overloaded.IO.Stream) GetLifetimeService (Inherited from System.

Top See Also Reference C1ZStreamWriter Class C1. SetLength Overridden. Writes a byte to the current position in the stream and advances the position within the stream by one byte.Stream) WriteByte Overridden.IO.Stream) ReadByte (Inherited from System. WriteAsync Overloaded. C1ZStreamWriter Constructor(Stream.C1Zip Namespace C1ZStreamWriter Constructor Overload List Overload Description C1ZStreamWriter Constructor(Stream) Initializes a new instance of the C1ZStreamWrite r class. Not supported.Boolean) Initializes a new instance of the .Stream) Seek Overridden.Read Overridden. Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. Not supported.IO. ReadAsync Overloaded. (Inherited from System. (Inherited from System.IO. Write Overridden. Not supported.

Initializes a new instance of the C1ZStreamWriter class.C1ZStreamWrite r class. C1ZStreamWriter Constructor(Stream. Windows Server 2008 R2 (Server Core supported with SP1 or later).CompressionLevelEnum.Boolean.Boolean. Windows Vista SP1 or later.Boolean) Initializes a new instance of the C1ZStreamWrite r class. Syntax . C1ZStreamWriter Initializes a new Constructor(Stream.Boolean) Initializes a new instance of the C1ZStreamWrite r class.Boolean) instance of the C1ZStreamWrite r class.CompressionLevelEnum) Initializes a new instance of the C1ZStreamWrite r class. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members C1ZStreamWriter Constructor(Stream) Output stream that will contain the compressed data. Windows Server 2008 (Server Core not supported). Requirements Target Platforms: Windows 7. C1ZStreamWriter Constructor(Stream. Windows XP SP3. C1ZStreamWriter Constructor(Stream.CompressionLevelEnum.

Specifies whether the compressed stream should be compatible with zip files. Windows Vista SP1 or later. _ ByVal zip As Boolean _ ) . Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Overload List C1ZStreamWriter Constructor(Stream. Requirements Target Platforms: Windows 7. Syntax Visual Basic (Declaration) Public Function New( _ ByVal baseStream As Stream.Visual Basic (Declaration) Public Function New( _ ByVal baseStream As Stream _ ) C# public C1ZStreamWriter( Stream baseStream ) Parameters baseStream Output stream that will contain the compressed data.Boolean) Output stream that will contain the compressed data. Windows Server 2008 R2 (Server Core supported with SP1 or later). Initializes a new instance of the C1ZStreamWriter class.

Windows Server 2008 R2 (Server Core supported with SP1 or later).Boolean. Remarks Streams in zip files are different from regular zlib streams in two aspects: (1) zip streams do not contain any local header information (the information is stored in the zip file headers instead) and (2) zip streams use a CRC32 checksum instead of the adler32 checksum used by zlib streams. Windows XP SP3. Requirements Target Platforms: Windows 7. zip Specifies whether the compressed stream should be compatible with zip files.Boolean) > Name Open Description Gets the Open toolstrip button. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). bool zip ) Parameters baseStream Output stream that will contain the compressed data.C# public C1ZStreamWriter( Stream baseStream. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Overload List C1ZStreamWriter Constructor(Stream. .

Syntax . (Inherited from C1.PreviewToolBar) PageSetup Gets the PageSetup toolstrip button. PreviewControl Gets the preview control containing this toolbar.C1PrintPreviewControl. Parameters Gets the Parameters toolstrip button. ToolStrip Visible Gets the ToolStrip containing the buttons in this toolbar.PreviewToolBar) Print Gets the Print toolstrip button.Win.FileToolBar Class C1.Win.C1Preview.PreviewToolBar) Gets or sets a value indicating whether this toolbar is visible.C1PrintPreviewControl.C1Preview. (Inherited from C1. PreviewAction Overridden. PrintLayout Gets the PrintLayout toolstrip button. Initializes a new instance of the C1ZStreamWriter class.Win.C1Preview. (Inherited from C1.C1PrintPreviewControl. Save Gets the Save toolstrip button. Compression level to use when compressing data.PreviewToolBar) Top See Also Reference C1PrintPreviewControl.Win.Win.CompressionLevelEnum) Output stream that will contain the compressed data.Owner Gets the owner of this toolbar. Stop Gets the Stop toolstrip button.C1Preview Namespace C1ZStreamWriter Constructor(Stream.C1PrintPreviewControl. (Inherited from C1. Gets C1PreviewActionFlags describing the content of this toolbar. Reflow Gets the Reflow toolstrip button.C1Preview.

Requirements Target Platforms: Windows 7. Windows XP SP3. Syntax . Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later). Compression level to use when compressing data.CompressionLevelEnum. Specifies whether the compressed stream should be compatible with zip files. _ ByVal level As CompressionLevelEnum _ ) C# public C1ZStreamWriter( Stream baseStream. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Overload List C1ZStreamWriter Constructor(Stream. Windows Server 2008 (Server Core not supported).Visual Basic (Declaration) Public Function New( _ ByVal baseStream As Stream. level Compression level to use when compressing data. CompressionLevelEnum level ) Parameters baseStream Output stream that will contain the compressed data.Boolean) Output stream that will contain the compressed data. Initializes a new instance of the C1ZStreamWriter class.

Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Overload List C1ZStreamWriter Constructor(Stream. _ ByVal zip As Boolean _ ) C# public C1ZStreamWriter( Stream baseStream.Boolean. zip Specifies whether the compressed stream should be compatible with zip files.CompressionLevelEnum. Windows Server 2008 (Server Core not supported). . level Compression level to use when compressing data. CompressionLevelEnum level.Boolean) Output stream that will contain the compressed data. Windows Server 2008 R2 (Server Core supported with SP1 or later). Requirements Target Platforms: Windows 7.Visual Basic (Declaration) Public Function New( _ ByVal baseStream As Stream. Windows Vista SP1 or later. _ ByVal level As CompressionLevelEnum. bool zip ) Parameters baseStream Output stream that will contain the compressed data.

bool header. crc32 Include CRC32 checksum in compressed stream (should be True for streams in zip files). Include header information in compressed stream (should be False for streams in zip files). CompressionLevelEnum level. Include CRC32 checksum in compressed stream (should be True for streams in zip files). Syntax Visual Basic (Declaration) Public Function New( _ ByVal baseStream As Stream. Initializes a new instance of the C1ZStreamWriter class. _ ByVal crc32 As Boolean _ ) C# public C1ZStreamWriter( Stream baseStream. _ ByVal level As CompressionLevelEnum.Compression level to use when compressing data. header Include header information in compressed stream (should be False for streams in zip files). _ ByVal header As Boolean. bool crc32 ) Parameters baseStream Output stream that will contain the compressed data. Requirements . level Compression level to use when compressing data.

Target Platforms: Windows 7.Stream) Overridden.IO.Stream) Flush Overridden.IO.IO. then this method also closes the base stream and releases any resources (such as sockets and file handles) associated with it.Stream) CopyToAsync Overloaded. CopyTo Overloaded. Windows Vista SP1 or later. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Overload List Methods > Name Description BeginRead (Inherited from System.IO.Stream) BeginWrite (Inherited from System. Windows Server 2008 (Server Core not supported). Closes the current stream compressor and flushed any pending data into the base stream.Stream) EndRead (Inherited from System.MarshalByRefObject) Dispose (Inherited from System.Stream) CreateObjRef (Inherited from System.Stream) EndWrite (Inherited from System.IO.IO. Close If the OwnsBaseStream property is set to True (the default value). Clears all buffers for this stream and causes any buffered data to be written to the underlying stream. . (Inherited from System. (Inherited from System.IO.

Stream) Overridden. Writes a sequence of bytes to the current stream and Write advances the current position within this stream by the number of bytes written. Not supported.Stream) GetLifetimeService (Inherited from System.FlushAsync Overloaded. Overridden.Stream) ReadByte (Inherited from System. SetLength Overridden. Writes a byte to the current position in the stream and advances the position within the stream by one byte. (Inherited from System.C1Zip Namespace Close Method Closes the current stream compressor and flushed any pending data into the base stream.Stream) Seek Overridden. then this method also closes the base stream and releases any resources (such as sockets and file handles) associated with it. WriteAsync WriteByte Overloaded.IO. Syntax Visual Basic (Declaration) Public Overrides Sub Close() C# .MarshalByRefObject) Read Overridden.MarshalByRefObject) InitializeLifetimeService (Inherited from System. Not supported. (Inherited from System.IO.IO. Top See Also Reference C1ZStreamWriter Class C1. Not supported.IO. (Inherited from System. ReadAsync Overloaded. If the OwnsBaseStream property is set to True (the default value).

Windows Server 2008 (Server Core not supported). Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Flush Method Clears all buffers for this stream and causes any buffered data to be written to the underlying stream. Windows Vista SP1 or later.public override void Close() Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public Overrides Sub Flush() C# public override void Flush() Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Read Method Not supported. Windows XP SP3. Syntax .

Windows XP SP3. Windows Server 2008 (Server Core not supported). Syntax Visual Basic (Declaration) Public Overrides Function Seek( _ ByVal offset As Long. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Seek Method Not supported. int count ) Parameters buf offset count Requirements Target Platforms: Windows 7. int offset.Visual Basic (Declaration) Public Overrides Function Read( _ ByVal buf() As Byte. _ ByVal count As Integer _ ) As Integer C# public override int Read( byte[] buf. _ . _ ByVal offset As Integer.

Syntax Visual Basic (Declaration) Public Overrides Sub SetLength( _ ByVal value As Long _ ) C# public override void SetLength( long value ) Parameters . SeekOrigin origin ) Parameters offset origin Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members SetLength Method Not supported.ByVal origin As SeekOrigin _ ) As Long C# public override long Seek( long offset. Windows XP SP3.

Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). _ ByVal offset As Integer. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Write Method An array of bytes. . This method copies count bytes from buf to the current stream. Windows XP SP3. This method copies count bytes from buf to the current stream.value Requirements Target Platforms: Windows 7. int count ) Parameters buf An array of bytes. _ ByVal count As Integer _ ) C# public override void Write( byte[] buf. Windows Server 2008 R2 (Server Core supported with SP1 or later). The number of bytes to be written to the current stream. The zero-based byte offset in buf at which to begin copying bytes to the current stream. Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. int offset. Syntax Visual Basic (Declaration) Public Overrides Sub Write( _ ByVal buf() As Byte.

Windows Vista SP1 or later. Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members WriteByte Method Value to be written to the stream. count The number of bytes to be written to the current stream. Windows XP SP3. Writes a byte to the current position in the stream and advances the position within the stream by one byte.offset The zero-based byte offset in buf at which to begin copying bytes to the current stream. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Remarks The data is compressed as it is written into the stream. Writing count bytes into the stream will usually advance the position by a number smaller than count. Syntax Visual Basic (Declaration) Public Overrides Sub WriteByte( _ ByVal value As Byte _ ) C# public override void WriteByte( byte value ) Parameters .

see C1ZStreamWriter members. Always returns False. CanRead Overridden. Public Properties Name Description BaseStream Gets the underlying stream that receives the compressed data. Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. in bytes.Stream) CanWrite Overridden. CanTimeout (Inherited from System. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Properties %%scrap%% " --> For a list of all members of this type.value Value to be written to the stream. Always returns False.IO. Checksum Gets the checksum value used to check the integrity of the stream. Length Overridden. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. . Returns the length of the underlying stream. CanSeek Overridden. Always returns True.

Top See Also Reference C1ZStreamWriter Class C1. Position Overridden.IO. Gets the position within the stream (read-only). Syntax Visual Basic (Declaration) Public ReadOnly Property BaseStream As Stream C# public Stream BaseStream {get. WriteTimeout (Inherited from System.IO.Stream) ZStream Gets the ZStream instance wrapped by this C1ZStreamWriter.} . SizeUncompressedLong Gets the number of bytes that were compressed into the stream (uncompressed bytes). ReadTimeout (Inherited from System. SizeCompressedLong Gets the number of bytes in the stream (compressed bytes).C1Zip Namespace BaseStream Property Gets the underlying stream that receives the compressed data.Stream) SizeCompressed Gets the number of bytes in the stream (compressed bytes). SizeUncompressed Gets the number of bytes that were compressed into the stream (uncompressed bytes).OwnsBaseStream Gets or sets whether calling the Close method will also close the underlying stream (see BaseStream).

Syntax Visual Basic (Declaration) Public Overrides ReadOnly Property CanRead As Boolean C# public override bool CanRead {get.Requirements Target Platforms: Windows 7. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Syntax Visual Basic (Declaration) . Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members CanSeek Property Always returns False. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members CanRead Property Always returns False. Windows Vista SP1 or later.} Requirements Target Platforms: Windows 7.

Windows Server 2008 (Server Core not supported). Syntax Visual Basic (Declaration) Public Overrides ReadOnly Property CanWrite As Boolean C# public override bool CanWrite {get. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members CanWrite Property Always returns True. Windows Vista SP1 or later.Public Overrides ReadOnly Property CanSeek As Boolean C# public override bool CanSeek {get. Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later.} Requirements Target Platforms: Windows 7.} Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Checksum Property Gets the checksum value used to check the integrity of the stream. .

Windows XP SP3. in bytes. Windows Server 2003 SP2 .} Remarks The checksum used may be an Adler or crc32 value depending on how the C1ZStreamWriter was created. Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Length Property Returns the length of the underlying stream. Windows Server 2008 R2 (Server Core supported with SP1 or later).} Requirements Target Platforms: Windows 7. Syntax Visual Basic (Declaration) Public Overrides ReadOnly Property Length As Long C# public override long Length {get.Syntax Visual Basic (Declaration) Public ReadOnly Property Checksum As Integer C# public int Checksum {get. Windows Vista SP1 or later. Windows Vista SP1 or later. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later).

set. Syntax Visual Basic (Declaration) Public Property OwnsBaseStream As Boolean C# public bool OwnsBaseStream {get. Syntax Visual Basic (Declaration) Public Overrides Property Position As Long C# public override long Position {get.See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members OwnsBaseStream Property Gets or sets whether calling the Close method will also close the underlying stream (see BaseStream).} Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). set. Windows Vista SP1 or later.} . Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members Position Property Gets the position within the stream (read-only). Windows Server 2008 (Server Core not supported).

Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members SizeCompressed Property Gets the number of bytes in the stream (compressed bytes). Windows Server 2008 (Server Core not supported).Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Syntax Visual Basic (Declaration) . Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public ReadOnly Property SizeCompressed As Integer C# public int SizeCompressed {get. Windows XP SP3. Windows XP SP3. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members SizeCompressedLong Property Gets the number of bytes in the stream (compressed bytes). Windows Vista SP1 or later.} Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later).

Windows XP SP3.} Requirements Target Platforms: Windows 7.Public ReadOnly Property SizeCompressedLong As Long C# public long SizeCompressedLong {get. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Windows XP SP3. Syntax Visual Basic (Declaration) Public ReadOnly Property SizeUncompressed As Integer C# public int SizeUncompressed {get. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. . Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members SizeUncompressed Property Gets the number of bytes that were compressed into the stream (uncompressed bytes). Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members SizeUncompressedLong Property Gets the number of bytes that were compressed into the stream (uncompressed bytes).} Requirements Target Platforms: Windows 7.

Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members ZStream Property Gets the ZStream instance wrapped by this C1ZStreamWriter.Syntax Visual Basic (Declaration) Public ReadOnly Property SizeUncompressedLong As Long C# public long SizeUncompressedLong {get. Windows Server 2003 SP2 . Requirements Target Platforms: Windows 7.} Requirements Target Platforms: Windows 7. Windows XP SP3. Syntax Visual Basic (Declaration) Public ReadOnly Property ZStream As ZStream C# public ZStream ZStream {get. It is not needed in common applications. Windows XP SP3. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later).} Remarks This property is useful only in advanced applications that need to customize the low-level behavior of the compressor.

Object System.ZipFileException Requirements Target Platforms: Windows 7.See Also Reference C1ZStreamWriter Class C1ZStreamWriter Members ZipFileException Exception thrown when trying to open an invalid Zip file.SystemException System. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported).IOException C# public class ZipFileException : System.C1Zip. Windows Server 2003 SP2 See Also Reference ZipFileException Members C1.IO.IO.C1Zip Namespace . Object Model Syntax Visual Basic (Declaration) Public Class ZipFileException Inherits System. Windows Vista SP1 or later.IOException Inheritance Hierarchy System.IO.IOException C1.Exception System.

IOException C1.Exception System.IO.IO.Overview Exception thrown when trying to open an invalid Zip file. Windows Server 2008 (Server Core not supported).C1Zip.C1Zip Namespace Members Properties Methods The following tables list the members exposed by ZipFileException.IOException Inheritance Hierarchy System. Object Model Syntax Visual Basic (Declaration) Public Class ZipFileException Inherits System. Windows Vista SP1 or later. Windows XP SP3.IOException C# public class ZipFileException : System.Object System.IO. Windows Server 2003 SP2 See Also Reference ZipFileException Members C1. Windows Server 2008 R2 (Server Core supported with SP1 or later).ZipFileException Requirements Target Platforms: Windows 7. Public Constructors .SystemException System.

Exception) Top Public Methods Name Description GetBaseException (Inherited from System.Exception) HelpLink (Inherited from System.Exception) .Exception) TargetSite (Inherited from System.Name Description ZipFileException Constructor Overloaded.Exception) Source (Inherited from System. Top Public Properties Name Description Data (Inherited from System.Exception) Message (Inherited from System.Exception) GetType (Inherited from System.Exception) InnerException (Inherited from System.Exception) Top GetObjectData (Inherited from System.Exception) ToString (Inherited from System.Exception) HResult (Inherited from System.Exception) StackTrace (Inherited from System.

Requirements Target Platforms: Windows 7. ZipFileException Constructor(String. Windows Server 2008 R2 (Server Core supported with SP1 or later).C1Zip Namespace ZipFileException Constructor Overload List Overload Description ZipFileException Constructor(String) Initializes a new instance of a ZipFileException. Windows Server 2008 (Server Core not supported). Initializes a new instance of a ZipFileException.Exception) Initializes a new instance of a ZipFileException. Windows Vista SP1 or later. ZipFileException Constructor(String.See Also Reference ZipFileException Class C1. Windows Server 2003 SP2 See Also Reference ZipFileException Class ZipFileException Members ZipFileException Constructor(String) Message that describes the exception. Syntax Visual Basic (Declaration) Public Function New( _ .String) Initializes a new instance of a ZipFileException.String. Windows XP SP3.

Name of the file that caused the exception. Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported).String) Message that describes the exception. Windows XP SP3.ByVal msg As String _ ) C# public ZipFileException( string msg ) Parameters msg Message that describes the exception. _ ByVal filename As String _ ) C# public ZipFileException( . Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference ZipFileException Class ZipFileException Members Overload List ZipFileException Constructor(String. Initializes a new instance of a ZipFileException. Syntax Visual Basic (Declaration) Public Function New( _ ByVal msg As String.

Requirements Target Platforms: Windows 7. filename Name of the file that caused the exception. _ ByVal filename As String. Syntax Visual Basic (Declaration) Public Function New( _ ByVal msg As String. Windows Vista SP1 or later.string msg. Initializes a new instance of a ZipFileException. _ ByVal innerException As Exception _ ) C# . Windows XP SP3. Name of the file that caused the exception. string filename ) Parameters msg Message that describes the exception. Inner exception. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later).String. Windows Server 2003 SP2 See Also Reference ZipFileException Class ZipFileException Members Overload List ZipFileException Constructor(String.Exception) Message that describes the exception.

Windows XP SP3. Exception innerException ) Parameters msg Message that describes the exception. innerException Inner exception. Windows Server 2003 SP2 See Also Reference ZipFileException Class ZipFileException Members Overload List ZipProgressEventArgs Provides data for the C1ZipFile.EventArgs .Progress event of a C1ZipFile. Windows Server 2008 R2 (Server Core supported with SP1 or later). filename Name of the file that caused the exception. Object Model Syntax Visual Basic (Declaration) Public Class ZipProgressEventArgs Inherits System. Requirements Target Platforms: Windows 7.public ZipFileException( string msg. Windows Vista SP1 or later. string filename. Windows Server 2008 (Server Core not supported).

EventArgs C1.Object System.EventArgs Inheritance Hierarchy System. Windows Server 2008 R2 (Server Core supported with SP1 or later).EventArgs C1. Object Model Syntax Visual Basic (Declaration) Public Class ZipProgressEventArgs Inherits System.C1Zip.Object System. Windows XP SP3.Progress event of a C1ZipFile.C# public class ZipProgressEventArgs : System.ZipProgressEventArgs .C1Zip Namespace Overview Provides data for the C1ZipFile. Windows Server 2008 (Server Core not supported).EventArgs Inheritance Hierarchy System. Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference ZipProgressEventArgs Members C1.EventArgs C# public class ZipProgressEventArgs : System.C1Zip.ZipProgressEventArgs Requirements Target Platforms: Windows 7.

Position Gets the current position into the stream. Top See Also Reference ZipProgressEventArgs Class C1. Windows XP SP3. Public Properties Name Description Cancel Set to true to cancel the current operation. FileLength Gets the length of the file being compressed or expanded.Requirements Target Platforms: Windows 7. FileLengthLong Gets the length of the file being compressed or expanded. Windows Server 2003 SP2 See Also Reference ZipProgressEventArgs Members C1. PositionLong Gets the current position into the stream. Windows Vista SP1 or later. FileName Gets the name of the file being compressed or expanded. Windows Server 2008 R2 (Server Core supported with SP1 or later).C1Zip Namespace .C1Zip Namespace Members Properties The following tables list the members exposed by ZipProgressEventArgs. Windows Server 2008 (Server Core not supported).

Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Top See Also Reference ZipProgressEventArgs Class C1.Properties > Name Description Cancel Set to true to cancel the current operation. FileName Gets the name of the file being compressed or expanded. Syntax Visual Basic (Declaration) Public Property Cancel As Boolean C# public bool Cancel {get. Position Gets the current position into the stream. set.} Requirements Target Platforms: Windows 7. FileLength Gets the length of the file being compressed or expanded. Windows Server 2008 (Server Core not supported). PositionLong Gets the current position into the stream. FileLengthLong Gets the length of the file being compressed or expanded. Windows Server 2003 SP2 See Also Reference . Windows Vista SP1 or later.C1Zip Namespace Cancel Property Set to true to cancel the current operation.

Windows Server 2008 R2 (Server Core supported with SP1 or later).} Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public ReadOnly Property FileLength As Integer C# public int FileLength {get. Syntax Visual Basic (Declaration) Public ReadOnly Property FileLengthLong As Long C# public long FileLengthLong {get. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 .ZipProgressEventArgs Class ZipProgressEventArgs Members FileLength Property Gets the length of the file being compressed or expanded. Windows XP SP3. Windows Server 2003 SP2 See Also Reference ZipProgressEventArgs Class ZipProgressEventArgs Members FileLengthLong Property Gets the length of the file being compressed or expanded.} Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Windows XP SP3.

Syntax Visual Basic (Declaration) Public ReadOnly Property Position As Integer C# public int Position {get. Windows Server 2008 (Server Core not supported).} Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference ZipProgressEventArgs Class ZipProgressEventArgs Members Position Property Gets the current position into the stream. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Windows XP SP3.See Also Reference ZipProgressEventArgs Class ZipProgressEventArgs Members FileName Property Gets the name of the file being compressed or expanded.} Requirements . Syntax Visual Basic (Declaration) Public ReadOnly Property FileName As String C# public string FileName {get.

Windows Server 2003 SP2 See Also Reference ZipProgressEventArgs Class ZipProgressEventArgs Members Enumerations CompressionLevelEnum Specifies the level of compression to be applied when adding entries to a C1ZipFile. Windows XP SP3. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported).} Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. Syntax Visual Basic (Declaration) . Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported).Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Syntax Visual Basic (Declaration) Public ReadOnly Property PositionLong As Long C# public long PositionLong {get. Windows Server 2003 SP2 See Also Reference ZipProgressEventArgs Class ZipProgressEventArgs Members PositionLong Property Gets the current position into the stream.

highest speed. high speed. DefaultCompression High compression.Enum C1. Windows XP SP3.Public Enum CompressionLevelEnum Inherits System. low speed.Object System.C1Zip. Syntax . Windows Server 2008 (Server Core not supported).ValueType System. Windows Server 2008 R2 (Server Core supported with SP1 or later).Enum C# public enum CompressionLevelEnum : System.Progress event of a C1ZipFile.Enum Members Member Description BestCompression Highest compression. Inheritance Hierarchy System.CompressionLevelEnum Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference C1. NoCompression No Compression. BestSpeed Low compression.C1Zip Namespace Delegates ZipProgressEventHandler Represents the method that will handle the C1ZipFile. Windows Vista SP1 or later.

C1Zip Namespace C1.ZLib Namespace Overview Classes Class Description ZStream ZStream is the most flexible and hardest to use class in the C1.Visual Basic (Declaration) Public Delegate Sub ZipProgressEventHandler( _ ByVal sender As Object. Windows Server 2008 R2 (Server Core supported with SP1 or later). which is a general purpose compressor and decompressor. Windows Server 2003 SP2 See Also Reference ZipProgressEventHandler Members C1. Windows XP SP3. _ ByVal e As ZipProgressEventArgs _ ) C# public delegate void ZipProgressEventHandler( object sender.C1Zip assembly. Windows Server 2008 (Server Core not supported).C1Zip. . ZipProgressEventArgs e ) Parameters sender e Requirements Target Platforms: Windows 7. It contains a C# implementation of ZLIB's zstream object. Windows Vista SP1 or later.

. and articles available at http://www. the official zlib sites. Object Model Syntax Visual Basic (Declaration) Public Class ZStream C# public class ZStream Remarks In most cases. These classes provide friendly and easyto-use wrappers that hide the ZLIB complexity.g. Use ZStream only if you are familiar with ZLIB and need control over the low-level aspects of the data compression or decompression process (e. to provide your own buffers or compression dictionaries). It contains a C# implementation of ZLIB's zstream object.C1Zip.ZStreamException The exception that is thrown when reading or writing to a compressed stream fails. please check out the detailed documentation.org/.org/ or http://www.4 Assembly Classes ZStream ZStream is the most flexible and hardest to use class in the C1. ZLIB is an open-source.C1ZStreamReader and C1.C1Zip. which is a general purpose compressor and decompressor.C1Zip assembly.C1ZStreamWriter classes instead of ZStream.info-zip. patent-free library created by Jean-Loup Gailly and Mark Adler.. If you choose to use ZStream directly and need technical support.gzip. sample. See Also Reference C1.C1Zip. you should be able to use the C1.

These classes provide friendly and easyto-use wrappers that hide the ZLIB complexity. to provide your own buffers or compression dictionaries).C1Zip assembly.Object C1.C1ZStreamReader and C1. you should be able to use the C1. Object Model Syntax Visual Basic (Declaration) Public Class ZStream C# public class ZStream Remarks In most cases.C1Zip. Use ZStream only if you are familiar with ZLIB and need control over the low-level aspects of the data compression or decompression process (e.. .ZStream Requirements Target Platforms: Windows 7.C1Zip.ZLib Namespace Overview ZStream is the most flexible and hardest to use class in the C1. Windows Server 2003 SP2 See Also Reference ZStream Members C1.C1Zip. Windows XP SP3. which is a general purpose compressor and decompressor.g. Windows Vista SP1 or later.C1ZStreamWriter classes instead of ZStream. Windows Server 2008 R2 (Server Core supported with SP1 or later).Inheritance Hierarchy System. Windows Server 2008 (Server Core not supported). It contains a C# implementation of ZLIB's zstream object.C1Zip.ZLib.

org/ or http://www.C1Zip. Windows Server 2008 (Server Core not supported). please check out the detailed documentation.ZLib Namespace Members Fields Methods The following tables list the members exposed by ZStream. Inheritance Hierarchy System. ZLIB is an open-source.Object C1. Windows XP SP3. and articles available at http://www.If you choose to use ZStream directly and need technical support.ZLib. Windows Server 2003 SP2 See Also Reference ZStream Members C1. avail_in Number of bytes available in the input buffer. .gzip.C1Zip. patent-free library created by Jean-Loup Gailly and Mark Adler.ZStream Requirements Target Platforms: Windows 7.info-zip. Public Constructors Name Description ZStream Constructor Overloaded. Top Public Fields Name Description adler Current checksum value (Adler or CRC32). sample.org/. the official zlib sites. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later.

avail_out Number of free bytes remaining in output buffer. next_out_index Position of cursor into the output buffer. Z_VERSION_ERROR Incompatible ZLIB version. Z_DATA_ERROR Input data is corrupted (wrong format or checksum). Z_STREAM_END End of stream detected. Top Public Methods . Z_OK No error. next_in Input buffer. total_out Total number of bytes output so far. Z_BUF_ERROR No progress possible or no room in output buffer. Z_STREAM_ERROR Stream structure is inconsistent (input/output buffers are null for example). next_in_index Position of cursor into input buffer. total_in Total number of input bytes read so far. next_out Output buffer. Z_NEED_DICT A preset dictionary is needed at this point. msg Description of the last error (null if no errors). Z_ERRNO File error. Z_MEM_ERROR Not enough memory.

inflateEnd Frees all dynamically allocated data structures for this stream. inflateInit Overloaded. Initializes the internal stream state for compression. Top See Also Reference ZStream Class C1. No output is provided. discards any unprocessed input. discards any unprocessed input. inflate Decompresses as much data as possible until the input buffer is exhausted or the output buffer is full. deflateSetDictionary Initializes the compression dictionary from the given byte sequence without producing any compressed output. deflateInit Overloaded. inflateSetDictionary Initializes the decompression dictionary from the given uncompressed byte sequence.ZLib Namespace . deflateParams Dynamically updates the compression level and compression strategy. Initializes the internal stream state for decompression. inflateSync Skips invalid compressed data until a full flush point is found. or until all available input is skipped. and does not flush any pending output.Name Description deflate Compresses as much data as possible. and stops when the input buffer becomes empty or the output buffer becomes full. and does not flush any pending output.C1Zip. deflateEnd Frees all dynamically allocated data structures for this stream.

Requirements Target Platforms: Windows 7. Windows XP SP3. Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public Function New() C# public ZStream() Requirements Target Platforms: Windows 7. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members ZStream Constructor() Initializes a new instance of the ZStream class using an Adler checksum. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported).ZStream Constructor Overload List Overload Description ZStream Constructor() Initializes a new instance of the ZStream class using an Adler checksum. Windows Server 2008 R2 (Server Core supported with SP1 or later). ZStream Constructor(Boolean) Initializes a new instance of the ZStream class. Windows XP SP3. Windows Vista SP1 or later. Windows Server 2003 SP2 See Also Reference .

False to use an Adler checksum. Adler checksums are the default used by ZLIB. Syntax Visual Basic (Declaration) Public Function New( _ ByVal crc32 As Boolean _ ) C# public ZStream( bool crc32 ) Parameters crc32 True to use a CRC32 checksum. False to use an Adler checksum. Initializes a new instance of the ZStream class. Remarks CRC32 checksums are the standard used in zip files. Adler checksums are faster to calculate.ZStream Class ZStream Members Overload List ZStream Constructor(Boolean) True to use a CRC32 checksum. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Overload List . Windows Vista SP1 or later. but are not compatible with the zip format. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Requirements Target Platforms: Windows 7.

Initializes the internal stream state for compression. discards any unprocessed input. or until all available input is skipped. deflateEnd Frees all dynamically allocated data structures for this stream. inflateSetDictionary Initializes the decompression dictionary from the given uncompressed byte sequence. deflateParams Dynamically updates the compression level and compression strategy. inflateInit Overloaded. see ZStream members. and stops when the input buffer becomes empty or the output buffer becomes full. No output is provided. deflateInit Overloaded.Methods %%scrap%% " --> For a list of all members of this type. deflateSetDictionary Initializes the compression dictionary from the given byte sequence without producing any compressed output. discards any unprocessed input. inflateSync Skips invalid compressed data until a full flush point is found. Initializes the internal stream state for decompression. inflateEnd Frees all dynamically allocated data structures for this stream. Top . Public Methods Name Description deflate Compresses as much data as possible. and does not flush any pending output. inflate Decompresses as much data as possible until the input buffer is exhausted or the output buffer is full. and does not flush any pending output.

2. Provide more output starting at next_out and update next_out and avail_out accordingly. and stops when the input buffer becomes empty or the output buffer becomes full. an error code on failure. Remarks deflate performs one or both of the following actions: 1. Forcing flush frequently degrades the compression ratio.C1Zip. Compresses as much data as possible. next_in and avail_in are updated and processing will resume at this point for the next call to deflate. Return Value Zero on success. If not all input can be processed (because there is not enough room in the output buffer). This action is forced if the parameter flush is non zero. Compress more input starting at next_in and update next_in and avail_in accordingly.ZLib Namespace deflate Method Non-zero to force some data to be flushed into the output buffer.See Also Reference ZStream Class C1. Syntax Visual Basic (Declaration) Public Function deflate( _ ByVal flush As Integer _ ) As Integer C# public int deflate( int flush ) Parameters flush Non-zero to force some data to be flushed into the output buffer. so this parameter should be set only when .

Windows Server 2008 (Server Core not supported). an error code on failure. Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also . Windows XP SP3. this method must be called again with the same value of the flush parameter and more output space until the flush is complete (deflate returns with avail_out != 0). Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later. Windows Vista SP1 or later. discards any unprocessed input. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members deflateEnd Method Frees all dynamically allocated data structures for this stream. Requirements Target Platforms: Windows 7.necessary (in interactive applications). Windows XP SP3. Some output may be provided even if flush is not set This method may introduce some output latency (reading input without producing any output) except when forced to flush. Syntax Visual Basic (Declaration) Public Function deflateEnd() As Integer C# public int deflateEnd() Return Value Zero on success. If deflate returns with avail_out == 0. Windows Server 2008 R2 (Server Core supported with SP1 or later). and does not flush any pending output.

Initializes the internal stream state for compression. deflateInit(Int32.Int32) Initializes the internal stream state for compression. Windows Server 2008 (Server Core not supported). Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members deflateInit(Int32) Method Compression level between zero and nine (0-9). Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public Overloads Function deflateInit( _ ByVal level As Integer _ ) As Integer C# public int deflateInit( int level .Reference ZStream Class ZStream Members deflateInit Method Initializes the internal stream state for compression. Overload List Overload Description deflateInit(Int32) Initializes the internal stream state for compression. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later).

_ . Syntax Visual Basic (Declaration) Public Overloads Function deflateInit( _ ByVal level As Integer. 9 gives best compression. Windows Server 2008 (Server Core not supported). Size of the LZ77 sliding compression window in bits (the default value is 15 bits). The default compression level is 6. an error code on failure. Compression level zero gives no compression at all (the input data is simply copied a block at a time). Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Overload List deflateInit(Int32. Windows Server 2008 R2 (Server Core supported with SP1 or later). which provides a compromise between speed and compression. Initializes the internal stream state for compression. Windows Vista SP1 or later.) Parameters level Compression level between zero and nine (0-9). Remarks Compression level 1 gives best speed. Windows XP SP3. Requirements Target Platforms: Windows 7.Int32) Method Compression level between zero and nine (0-9). Return Value Zero on success.

ByVal bits As Integer _ ) As Integer C# public int deflateInit( int level. an error code on failure. The default compression level is 6. Remarks Compression level 1 gives best speed. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Overload List . Windows Server 2008 R2 (Server Core supported with SP1 or later). Compression level zero gives no compression at all (the input data is simply copied a block at a time). Return Value Zero on success. which provides a compromise between speed and compression. Windows XP SP3. 9 gives best compression. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). int bits ) Parameters level Compression level between zero and nine (0-9). bits Size of the LZ77 sliding compression window in bits (the default value is 15 bits). Requirements Target Platforms: Windows 7.

strategy Compression strategy (0-2). Windows Server 2008 (Server Core not supported).deflateParams Method Compression level between zero and nine (0-9). Syntax Visual Basic (Declaration) Public Function deflateParams( _ ByVal level As Integer. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members deflateSetDictionary Method Data in the dictionary. Dynamically updates the compression level and compression strategy. . Windows XP SP3. Windows Vista SP1 or later. Windows Server 2008 R2 (Server Core supported with SP1 or later). Compression strategy (0-2). Requirements Target Platforms: Windows 7. _ ByVal strategy As Integer _ ) As Integer C# public int deflateParams( int level. int strategy ) Parameters level Compression level between zero and nine (0-9).

The compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). dictLength Number of bytes in the dictionary. Windows Server 2003 SP2 .Number of bytes in the dictionary. Return Value Zero on success. an error code on failure. Windows XP SP3. int dictLength ) Parameters dictionary Data in the dictionary. before any call to deflate. Windows Vista SP1 or later. Remarks This method must be called immediately after deflateInit(Int32). Initializes the compression dictionary from the given byte sequence without producing any compressed output. _ ByVal dictLength As Integer _ ) As Integer C# public int deflateSetDictionary( byte[] dictionary. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Requirements Target Platforms: Windows 7. Syntax Visual Basic (Declaration) Public Function deflateSetDictionary( _ ByVal dictionary() As Byte.

See Also Reference ZStream Class ZStream Members inflate Method How to flush data into the output buffer (default value is 2). Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced. Z_NEED_DICT if a preset dictionary is needed at this point. Return Value Z_OK if some progress has been made (more input processed or more output produced). Z_BUF_ERROR if no progress is possible or if there was not enough room in the output buffer when Z_FINISH is used. Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect checksum). Z_MEM_ERROR if there was not enough memory. Remarks inflate performs one or both of the following actions: . Z_STREAM_ERROR if the stream structure was inconsistent (for example if next_in or next_out was null). Decompresses as much data as possible until the input buffer is exhausted or the output buffer is full. Syntax Visual Basic (Declaration) Public Function inflate( _ ByVal flush As Integer _ ) As Integer C# public int inflate( int flush ) Parameters flush How to flush data into the output buffer (default value is 2).

discards any unprocessed input. Requirements Target Platforms: Windows 7. next_in is updated and processing will resume at this point for the next call to inflate. Windows Server 2008 (Server Core not supported). by providing more input and/or consuming more output. Provide more output starting at next_out and update next_out and avail_out accordingly. The application can consume the uncompressed output when it wants. inflate provides as much output as possible. and updating the next_* and avail_* values accordingly. Syntax Visual Basic (Declaration) Public Function inflateEnd() As Integer C# public int inflateEnd() . Decompress more input starting at next_in and update next_in and avail_in accordingly. Windows Vista SP1 or later. This method may introduce some output latency (reading input without producing any output) except when forced to flush. or after each call of inflate. Before the call to inflate. Windows Server 2008 R2 (Server Core supported with SP1 or later).1. it must be called again after making room in the output buffer because there might be more output pending. If not all input can be processed (because there is not enough room in the output buffer). Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members inflateEnd Method Frees all dynamically allocated data structures for this stream. until there is no more input data or no more space in the output buffer. and does not flush any pending output. the application should ensure that at least one of the actions is possible. If inflate returns Zero and avail_out == 0. for example when the output buffer is full (avail_out == 0). Windows XP SP3. 2.

Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members inflateInit() Method Initializes the internal stream state for decompression. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Syntax . Overload List Overload Description inflateInit() Initializes the internal stream state for decompression. Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members inflateInit Method Initializes the internal stream state for decompression.Return Value Zero on success. Windows Vista SP1 or later. Requirements Target Platforms: Windows 7. an error code on failure. Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. inflateInit(Int32) Initializes the internal stream state for decompression. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later).

Requirements Target Platforms: Windows 7. but next_out and avail_out are unchanged. the next_in and avail_in may be modified. Windows Vista SP1 or later. Remarks The fields next_in and avail_in must be initialized before by the caller. Windows Server 2008 (Server Core not supported). Syntax Visual Basic (Declaration) Public Overloads Function inflateInit( _ ByVal bits As Integer _ ) As Integer . Windows XP SP3.Visual Basic (Declaration) Public Overloads Function inflateInit() As Integer C# public int inflateInit() Return Value Zero on success. Therefore. inflateInit does not perform any decompression apart from reading the zlib header if present: data decompression is done by the inflate method. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Overload List inflateInit(Int32) Method Size of the LZ77 sliding compression window in bits (the default value is 15 bits). Initializes the internal stream state for decompression. Windows Server 2008 R2 (Server Core supported with SP1 or later). an error code on failure.

C# public int inflateInit( int bits ) Parameters bits Size of the LZ77 sliding compression window in bits (the default value is 15 bits). Return Value Zero on success. Syntax Visual Basic (Declaration) Public Function inflateSetDictionary( _ ByVal dictionary() As Byte. _ ByVal dictLength As Integer _ ) As Integer C# . Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Overload List inflateSetDictionary Method Data in the dictionary. Windows Server 2008 R2 (Server Core supported with SP1 or later). Requirements Target Platforms: Windows 7. Initializes the decompression dictionary from the given uncompressed byte sequence. an error code on failure. Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows Vista SP1 or later. Number of bytes in the dictionary.

Windows Server 2008 R2 (Server Core supported with SP1 or later). an error code on failure. No output is provided. Remarks This method must be called immediately after a call of inflate if this call returned Z_NEED_DICT. Windows Vista SP1 or later. or until all available input is skipped. The dictionary chosen by the compressor can be determined from the Adler32 value returned by this call to inflate. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members inflateSync Method Skips invalid compressed data until a full flush point is found. Syntax Visual Basic (Declaration) . int dictLength ) Parameters dictionary Data in the dictionary. Windows XP SP3. Requirements Target Platforms: Windows 7. The compressor and decompressor must use exactly the same dictionary (see the deflateSetDictionary method). dictLength Number of bytes in the dictionary. Windows Server 2008 (Server Core not supported). Return Value Zero on success.public int inflateSetDictionary( byte[] dictionary.

Windows Server 2008 (Server Core not supported). avail_out Number of free bytes remaining in output buffer. next_in_index Position of cursor into input buffer. an error code on failure. see ZStream members. Requirements Target Platforms: Windows 7. next_in Input buffer. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Fields %%scrap%% " --> For a list of all members of this type.Public Function inflateSync() As Integer C# public int inflateSync() Return Value Zero on success. Public Fields Name Description adler Current checksum value (Adler or CRC32). avail_in Number of bytes available in the input buffer. Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). msg Description of the last error (null if no errors). . Windows Vista SP1 or later.

Z_DATA_ERROR Input data is corrupted (wrong format or checksum). Syntax .ZLib Namespace adler Field Current checksum value (Adler or CRC32). Z_ERRNO File error. Z_BUF_ERROR No progress possible or no room in output buffer. Z_MEM_ERROR Not enough memory.next_out Output buffer. next_out_index Position of cursor into the output buffer. Z_NEED_DICT A preset dictionary is needed at this point. Top See Also Reference ZStream Class C1. Z_STREAM_ERROR Stream structure is inconsistent (input/output buffers are null for example). Z_OK No error.C1Zip. total_in Total number of input bytes read so far. Z_VERSION_ERROR Incompatible ZLIB version. total_out Total number of bytes output so far. Z_STREAM_END End of stream detected.

Windows Vista SP1 or later. Windows XP SP3. Windows Server 2008 (Server Core not supported). Syntax Visual Basic (Declaration) Public avail_in As Integer C# public int avail_in Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members . Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members avail_in Field Number of bytes available in the input buffer. Windows Server 2008 (Server Core not supported). Windows Vista SP1 or later.Visual Basic (Declaration) Public adler As Long C# public long adler Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later).

Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows XP SP3. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also . Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members msg Field Description of the last error (null if no errors). Windows XP SP3. Syntax Visual Basic (Declaration) Public msg As String C# public string msg Requirements Target Platforms: Windows 7. Syntax Visual Basic (Declaration) Public avail_out As Integer C# public int avail_out Requirements Target Platforms: Windows 7. Windows Vista SP1 or later. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported).avail_out Field Number of free bytes remaining in output buffer.

Reference
ZStream Class
ZStream Members

next_in Field
Input buffer.

Syntax
Visual Basic (Declaration)
Public next_in As Byte()
C#
public byte[] next_in

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
ZStream Class
ZStream Members

next_in_index Field
Position of cursor into input buffer.

Syntax
Visual Basic (Declaration)
Public next_in_index As Integer
C#
public int next_in_index

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
ZStream Class
ZStream Members

next_out Field
Output buffer.

Syntax
Visual Basic (Declaration)
Public next_out As Byte()
C#
public byte[] next_out

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
ZStream Class
ZStream Members

next_out_index Field
Position of cursor into the output buffer.

Syntax
Visual Basic (Declaration)
Public next_out_index As Integer

C#
public int next_out_index

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
ZStream Class
ZStream Members

total_in Field
Total number of input bytes read so far.

Syntax
Visual Basic (Declaration)
Public total_in As Long
C#
public long total_in

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
ZStream Class
ZStream Members

total_out Field
Total number of bytes output so far.

Syntax

Visual Basic (Declaration)
Public total_out As Long
C#
public long total_out

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
ZStream Class
ZStream Members

Z_BUF_ERROR Field
No progress possible or no room in output buffer.

Syntax
Visual Basic (Declaration)
Public Const Z_BUF_ERROR As Integer
C#
public const int Z_BUF_ERROR

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
ZStream Class
ZStream Members

Z_DATA_ERROR Field
Input data is corrupted (wrong format or checksum).

Syntax
Visual Basic (Declaration)
Public Const Z_DATA_ERROR As Integer
C#
public const int Z_DATA_ERROR

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also
Reference
ZStream Class
ZStream Members

Z_ERRNO Field
File error.

Syntax
Visual Basic (Declaration)
Public Const Z_ERRNO As Integer
C#
public const int Z_ERRNO

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or
later), Windows Server 2003 SP2

See Also

Syntax Visual Basic (Declaration) Public Const Z_MEM_ERROR As Integer C# public const int Z_MEM_ERROR Requirements Target Platforms: Windows 7. Windows XP SP3. Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Z_NEED_DICT Field A preset dictionary is needed at this point.Reference ZStream Class ZStream Members Z_MEM_ERROR Field Not enough memory. Syntax Visual Basic (Declaration) Public Const Z_NEED_DICT As Integer C# public const int Z_NEED_DICT Requirements . Windows Server 2008 R2 (Server Core supported with SP1 or later).

Windows Vista SP1 or later. Windows XP SP3. Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public Const Z_STREAM_END As Integer . Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Z_OK Field No error. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2008 (Server Core not supported).Target Platforms: Windows 7. Syntax Visual Basic (Declaration) Public Const Z_OK As Integer C# public const int Z_OK Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Z_STREAM_END Field End of stream detected. Windows Server 2008 R2 (Server Core supported with SP1 or later).

C# public const int Z_STREAM_END Requirements Target Platforms: Windows 7. Windows XP SP3. Windows XP SP3. Syntax . Windows Vista SP1 or later. Windows Server 2008 (Server Core not supported). Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later. Syntax Visual Basic (Declaration) Public Const Z_STREAM_ERROR As Integer C# public const int Z_STREAM_ERROR Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Z_STREAM_ERROR Field Stream structure is inconsistent (input/output buffers are null for example). Windows Server 2008 (Server Core not supported). Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members Z_VERSION_ERROR Field Incompatible ZLIB version.

Exception System. Windows XP SP3.ApplicationException C1.ZLib.ZStreamException . Object Model Syntax Visual Basic (Declaration) Public Class ZStreamException Inherits System. Windows Vista SP1 or later.C1Zip. Windows Server 2008 (Server Core not supported).ApplicationException C# public class ZStreamException : System.Visual Basic (Declaration) Public Const Z_VERSION_ERROR As Integer C# public const int Z_VERSION_ERROR Requirements Target Platforms: Windows 7. Windows Server 2008 R2 (Server Core supported with SP1 or later).Object System. Windows Server 2003 SP2 See Also Reference ZStream Class ZStream Members ZStreamException The exception that is thrown when reading or writing to a compressed stream fails.ApplicationException Inheritance Hierarchy System.

ApplicationException C1.ZLib Namespace Overview The exception that is thrown when reading or writing to a compressed stream fails. Object Model Syntax Visual Basic (Declaration) Public Class ZStreamException Inherits System.Exception System.Object System. Windows Vista SP1 or later.ApplicationException C# public class ZStreamException : System.C1Zip. Windows Server 2008 (Server Core not supported).C1Zip. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Vista SP1 or later.Requirements Target Platforms: Windows 7. Windows Server 2003 SP2 See Also Reference ZStreamException Members C1. Windows Server 2008 R2 (Server Core supported with SP1 or later). Windows Server 2003 SP2 See Also .ZStreamException Requirements Target Platforms: Windows 7.ApplicationException Inheritance Hierarchy System.ZLib. Windows Server 2008 (Server Core not supported). Windows XP SP3. Windows XP SP3.

Exception) InnerException (Inherited from System.Exception) StackTrace (Inherited from System.Exception) Source (Inherited from System.Exception) TargetSite (Inherited from System.Exception) HelpLink (Inherited from System. Public Properties Name Description Data (Inherited from System.Exception) Message (Inherited from System.ZLib Namespace Members Properties Methods The following tables list the members exposed by ZStreamException.Exception) Top Public Methods Name Description GetBaseException (Inherited from System.Exception) GetType (Inherited from System.Exception) HResult (Inherited from System.Exception) GetObjectData (Inherited from System.Reference ZStreamException Members C1.C1Zip.Exception) .

ZLib Namespace .Exception) Top See Also Reference ZStreamException Class C1.ToString (Inherited from System.C1Zip.