Zip Compression Tool Introduction

PowerTCP Zip Compression Tool

Support Licensing Distribution Getting Started

The PowerTCP Zip Compression Tool is designed with three core principles:

a) ease of use
b) speed
c) flexibility

To achieve all these goals we have created a component that offers both short-cut functionality with the QuickZip and QuickUnzip methods while also exposing a powerful FileStore object that provides extensive flexibility for your compression/decompression needs, regardless of whether data is moving between media or memory buffers. In addition, the PowerTCP Zip Compression Tool is designed to interoperate with the complete PowerTCP product line through our DartStream technology. A DartStream object can be filled with data in any PowerTCP product and manipulated using the Zip, Unzip, Load, Add and Extract methods.

Features of the PowerTCP Zip Compression Tool

  • Short-cut functions for compression/decompression with only one line of code!

  • Powerful FileStore object provides comprehensive functionality without using dozens of properties and methods

  • Flexible buffer-to-buffer, file-to-file, buffer-to-file, and file-to-buffer zip functionality.

  • You get both high speed and high compression without making a trade-off.

  • Fastest available compression/decompression performance for server/middle-tier implementations. The memory usage for the Zip control is optimized for high performance operating systems such as Windows NT/2000/XP, but will detect an older operating system such as Windows 95/98/Me and adjust memory manipulation as needed to make sure that the fastest possible operation is always achieved.

  • Interoperability with the PowerTCP product line using the DartStream object.

  • Support for both Windows zip standards and gzip for UNIX.

  • Configurable threading operation.

  • Span files across multiple disks or to a single directory.

Controls

Control | Description
Zip Control | Superior high-performance zip compression.

Supporting Objects

Object | Description
DartStream | Manages file access and buffers.
DartStreams | A collection of DartStream objects.
DartStrings | Collection of strings used as a supporting formatting object for several PowerTCP objects and controls.
File Object | Represents an individual file in the FileStore property.
FileAttributes Object | Represents attributes of an individual File object.
FileStore Object | Represents a collection of File objects and is exposed by the FileStore property in the Zip Control.
SpanSettings Object | The settings for a compressed file that will be spanned to multiple disks/volumes.

Sample Projects

The following sample projects demonstrate how to use the Zip Compression Tool:

Project | Description
FileSearch | Allows user to search for files using wildcards, if files are found they are given the option to zip them. BCB5, Delphi5, VB.NET, VB6, VC++
FolderArchive | Zips a folder and saves it to an archive directory. VB6
Dzip Console | PKZIP® style application. VC++
Unzipper | Demonstrates file extraction. BCB5, Delphi5, VB.NET, VB6, VC++
Zip Manager | Demonstrates a WinZIP® style application. VB6

Online ASP Samples

These ASP samples demonstrate the use of the Zip Compression Tool on the Internet. You must have an active Internet connection to view these samples.

Sample

Description

Zip/PowerTCP Product Interop

Demonstrates interoperability between the Zip Compression Tool and the PowerTCP product line by grabbing a file on the Internet with the Web Enterprise Tool, and zipping it with the Zip Compression Tool.

Online ASP.NET Samples

These ASP.NET samples demonstrate the use of the Zip Compression Tool on the Internet in the .NET Framework. You must have an active Internet connection to view these samples.

Sample

Description

Zip/PowerTCP Product Interop

Demonstrates interoperability between the Zip Compression Tool and the PowerTCP product line by grabbing a file on the Internet with the Web Enterprise Tool, and zipping it with the Zip Compression Tool.


Getting Started With The Zip Compression Tool

This section of the help file is intended to give a brief introduction to the power of the PowerTCP Zip Compression Tool. The following topics are intended to serve as a "Quick Start", to get you developing as quickly as possible. The following topics are addressed:

Zipping a File With the QuickZip Method:
This topic discusses the QuickZip method, the quickest and easiest way to add instant zipping functionality to your application with only a single line of code. Read this topic when you simply want to add zip functionality without fine-tuned file support, spanning, or zipping to/from a buffer.

Unzipping a File With the QuickUnzip Method:
This topic discusses the QuickUnzip method, which enables the ability to add instant unzipping functionality to your application with only a single line of code. Read this topic when you simply want to add unzip functionality without fine-tuned file support, spanning, or unzipping to/from a buffer.

Zipping Files Using the FileStore Object:
This topic demonstrates the power of the FileStore object in creating zip files. Read this topic if you need to use advanced zip functionality not covered by the QuickZip method.

Unzipping Files Using the FileStore Object:
This topic demonstrates the power of the FileStore object in unzipping zip files. Read this topic when you need to use advanced unzip functionality not covered by the QuickUnzip method.

Fine-Tuned File Support:
This topic discusses the ability to fine-tune zip files to the file-level using the File object and the FileAttributes object. Also discusses the ability to extract a single file from a zip file using the Extract method.

Showing Progress Information:
This topic demonstrates how to get progress information of a zip operation using the Progress event.

Zipping/Unzipping To/From a Buffer:
This topic demonstrates how the PowerTCP Zip Compression Tool provides buffer-to-buffer, file-to-file, buffer-to-file, and file-to-buffer zip functionality.

Zip Control, PowerTCP Product Interop:
This topic demonstrates how the PowerTCP Zip Compression Tool can interoperate with the PowerTCP product line through DartStream technology.


Using QuickZip

Zipping A File With The QuickZip Method

The PowerTCP Zip Compression Tool was created both to support those who wanted to add simple, "instant" zipping functionality, and to support those who wanted to add robust, fine-tuned zipping functionality. The QuickZip method was created to meet the first of those requirements while still allowing a great deal of flexibility.

The QuickZip method allows for the creation of a zip file with one line of code. This method is best when individual file manipulation is not needed, zipping will not involve a buffer, or you simply want to get started as quickly as possible. The following examples demonstrates the flexibility that can be achieved using this method.

Example 1: Zipping a single file using the QuickZip method.

This example demonstrates the simplest method of zipping a file. Use the QuickZip method, specifying the file to be zipped as the source (1st parameter), and the filename of the zipped file as the destination (2nd parameter).

Zip1.QuickZip "c:\temp\test.txt", "c:\temp\test.zip"

It is just as easy to zip multiple files using the QuickZip method, as the next example illustrates.

Example 2: Zipping multiple files using the QuickZip method.

You can do this one of two ways, the first by naming each file explicitly, delimited by commas,

' This will zip test1.txt and test2.txt into test.zip

Zip1.QuickZip "c:\temp\test1.txt,c:\temp\test2.txt", "c:\temp\test.zip"

and the second by using wildcards.

' This will zip all files and directories in the directory c:\temp into test.zip.

Zip1.QuickZip "c:\temp\*", "c:\test.zip", True, True

The above example also demonstrates using the IncludeSubs and PreservePath parameters. Setting these two parameters to true means that all subdirectories will be included in the zipped file and the directory structure will be preserved.

Example 3: Standard encryption using the QuickZip method

The QuickZip method also has the capability of providing standard zip encryption during the zip operation. this is done by providing values for the optional parameters, Password and Encryption.

' This will zip test.txt and encrypt it, using "mypass" as the password

Zip1.QuickZip "c:\temp\test.txt", "c:\temp\test.zip", True, True, "mypass", zipStandard


Using QuickUnzip

Unzipping A File With The QuickUnzip Method

The QuickUnzip method is the quickest and easiest way to add unzipping functionality to your application. As stated in the "Zipping a File With the QuickZip Method" topic, this method is best when individual file manipulation is not needed, unzipping will not involve a buffer, or you simply want to get started as quickly as possible.

The QuickUnzip method allows extracting from a compressed file with a single line of code. The following examples demonstrate this.

Example 1: Unzipping a compressed file.

This example demonstrates the simplest method of unzipping a compressed file. Use the QuickUnzip method, specifying the file to be unzipped as the source (1st parameter) and the directory where the files are to be unzipped as the destination (2nd parameter).

' Unzip test.zip into the c:\temp\unzipped directory.

Zip1.QuickUnzip "c:\temp\test.zip", "c:\temp\unzipped\"

The above example also has the PreservePath parameter as true, so the directory structure of the zip file will be preserved when uncompressed.

Example 2: Unzipping an encrypted compressed file.

This example demonstrates unzipping a file that has been encrypted with standard zip encryption (see Example 3 of the "Zipping A File With The QuickZip" topic). To do this, a valid value has to be provided for the Password parameter.

' Unzip test.zip which has been encrypted with "mypass" as the password

Zip1.QuickUnzip "c:\temp\test.zip", "c:\temp\unzipped\", True, "mypass"


Using the FileStore Object Zip Method

Using the QuickZip method is an excellent way to quickly add zip functionality to any application. You may find , however, that you may need more functionality and flexibility than the QuickZip method provides. The FileStore object, which represents a collection of files, provides this functionality. Some of the benefits of using the FileStore object Zip and Unzip methods over the QuickZip and QuickUnzip methods include:

  • Ability to fine-tune file properties.

  • Ability to zip data from a buffer.

  • Ability to span data over multiple volumes.

  • Ability to extract a single file from a compressed file containing multiple files.

  • Ability to interoperate with the PowerTCP product line.

Before you can use the Zip method, the FileStore object must first be populated. This is done by using the Add method, which creates a File object in the FileStore representing the file that has just been added.

Example 1: Adding multiple files to the FileStore object then zipping

The following example demonstrates adding several files to the FileStore, then zipping them.

' Add items to the FileStore using the Add method

Zip1.FileStore.Add "c:\temp\file1.txt"

Zip1.FileStore.Add "c:\temp\file2.txt"

Zip1.FileStore.Add "c:\temp\file3.txt"

' Zip all the files into "zippedfiles.zip"

Zip1.FileStore.Zip "c:\temp\zippedfiles.zip"

Example 2: Demonstrating the other parameters of the Add method.

The Add method, as with the QuickZip method, allows a great deal of flexibility in how the files are added and zipped. Wildcards can be used to add many files, even entire directories, at once, keeping the structure of the files intact.

' Add an entire directory and all subdirectories, keeping the directory structure intact.

Zip1.FileStore.Add "c:\temp\*.*", True, True

' Zip the FileStore

Zip1.FileStore.Zip "c:\myzippedfile.zip"

While the value of using the Zip method over the QuickZip method may not be immediately apparent, the topics to come should more clearly illustrate the benefits.


Using the FileStore Object Unzip Method

As mentioned in the "Using the FileStore Object Zip Method" topic, using the Zip and Unzip methods has many advantages over using the QuickZip and QuickUnzip methods.

As with the Zip method, before unzipping a compressed file with the Unzip method, the FileStore must first be populated. This is done by using the Load method.

Example 1: Loading a compressed file into the FileStore and unzipping.

This example demonstrates loading a compressed file into the FileStore, then unzipping.

' Load a compressed file, this populates the FileStore

Zip1.FileStore.Load "c:\temp\zipstuff.zip"

' Unzip the compressed file into the directory c:\temp\unzipped

Zip1.FileStore.Unzip "c:\temp\unzipped"

The above example doesn't really demonstrate the benefits of the FileStore. Once populated, you have a great deal of control and flexibility over the individual files in the FileStore (for more information on this, see the "Fine-Tuned File Support" topic).

Example 2: Loading a compressed file and displaying information about the individual files.

' Load a compressed file, this populates the FileStore

Zip1.FileStore.Load "c:\temp\zipstuff.zip"

' Iterate through the FileStore, displaying information about the files

' contained within the compressed file.

Dim file As file

For Each file In Zip1.FileStore

List1.AddItem "File name: " & file.Name

List1.AddItem "File size: " & file.Size

Next

As the above example attempts to illustrate, the FileStore object can be quite handy at organizing, displaying information about, and searching for files. In fact, it can even be used separately from the Zip Control for these purposes.


Fine-Tuned File Support

Fine-Tuned File Support With The FileStore Object

The FileStore object has benefits other than those illustrated in the "Using the Zip Method" and "Using the Unzip Method". One of these is the ability to manipulate files on the file level. You may recall that each file added to the FileStore is represented by a File object. This allows, once the FileStore has been populated, the ability to retrieve file information and change file information about a particular file, as the following example illustrates.

Example 1: Loading a compressed file and displaying information about the individual files contained within.

' Load a compressed file, this populates the FileStore (assume zipstuff.zip

' contains multiple files).

Zip1.FileStore.Load "c:\temp\zipstuff.zip"

' Iterate through the FileStore, displaying information about the files

' contained within the compressed file.

Dim file As file

For Each file In Zip1.FileStore

List1.AddItem "File name: " & file.Name

List1.AddItem "File size: " & file.Size

Next

You may also may want to change information about a file, prior to zipping, as illustrated in this example.

Example 2: Adding uncompressed files to the FileStore, changing info about them, then zipping.

The following example demonstrates changing file information about the files contained within the FileStore. In this example, all the files in the FileStore have the extension ".ar" added, then they are zipped and placed into an archive directory.

' Populate the FileStore

Zip1.FileStore.Add "C:\temp\file1.txt"

Zip1.FileStore.Add "C:\temp\file2.txt"

Zip1.FileStore.Add "C:\temp\file3.txt"

Dim file As file

' Iterate through the FileStore and change the name of each file

For Each file In Zip1.FileStore

file.Name = file.Name + ".ar"

Next

' Zip the FileStore, all files within will have the extension .ar tagged

' on the file

Zip1.FileStore.Zip "C:\temp\archive.zip"

Example 3: Using the FileAttributes Object

The FileAttributes object was provided to allow easy access to the attributes of a particular file in the FileStore. The following example demonstrates using the ReadOnlyFile property of the FileAttributes object to add a series of files to the FileStore, changing them to be read-only files, then zipping them.

' Add files to the FileStore

Zip1.FileStore.Add ("c:\temp\file1.txt")

Zip1.FileStore.Add ("c:\temp\file2.txt")

Zip1.FileStore.Add ("c:\temp\file3.txt")

Dim file As file

' Iterate through the FileStore, and change all files to read-only

For Each file In Zip1.FileStore

file.Attributes.ReadOnlyFile = True

Next

' Zip the files, when they are unzipped they will all be read-only

Zip1.FileStore.Zip "c:\temp\readonly.zip"

Example 4: Extracting a single file from a compressed file.

When a compressed file containing multiple files is loaded into the FileStore, it may be desirable to extract a single file from the FileStore instead of unzipping all files in the FileStore. The following example illustrates this.

' Load the FileStore with a compressed file containing several files.

Zip1.FileStore.Load ("c:\temp\zipstuff.zip")

' Extract the first file to the directory C:\temp.

Zip1.FileStore(1).Extract ("c:\temp\")


Showing Progress Information

You may wish (especially when dealing with very large files) to display information about the progress of the operation to the user. With the PowerTCP Zip Compression Tool, this is done using the Progress event.

Before using the Progress event there are a few things to consider. One of these is the DoEvents property, which must be set to true in order for the Progress event to fire. The DoEvents property defaults to true so this property usually does not need to be explicitly set to true. It's primary usage is in stateless environments such as IIS in which case it needs to be set to false so events are not fired.

The second thing to consider is the ProgressSize property, which sets how often the Progress event is raised. This property defaults to 1024, which means the Progress event will be raised for every 1024 kilobytes processed. You may find it necessary to "tweak" this property to gain maximum performance.

Example 1: Displaying progress information to the user during a zip operation.

Private Sub Command1_Click()

' DoEvents usually does not need to be set for events, as it defaults to true

Zip1.DoEvents = True

' Set Progress event to be raised every 3000 KB

Zip1.ProgressSize = 3000

' Add a file to the filestore

Zip1.FileStore.Add "c:\temp\reallybigfile.exe"

' Zip the file

Zip1.FileStore.Zip "c:\temp\zipped.zip"

End Sub

Private Sub Zip1_Progress(ByVal Status As DartZipCtl.ZipStatusConstants, ByVal file As DartZipCtl.IFile, ByVal FileNumber As Long, ByVal FileBytes As Long, ByVal TotalBytes As Long)

' Progress event has been raised, display the # of bytes processed

Label1.Caption = "Completed " & FileBytes

End Sub

This example serves well as a demonstration but it is not very practical. The reason why is that this event will be raised for many zip operations other than the actual zipping. For example, the Progress event will be raised when the zip operation begins and when it ends. In the latter case, the FileBytes parameter will be 0. You can determine what operation is taking place by checking the Status parameter. The following example illustrates this.

Example 2: Displaying progress information to the user during a zip operation (part 2)

Private Sub Command1_Click()

' DoEvents usually does not need to be set for events, as it defaults to true

Zip1.DoEvents = True

' Set Progress event to be raised every 3000 KB

Zip1.ProgressSize = 3000

' Add a file to the filestore

Zip1.FileStore.Add "c:\temp\reallybigfile.exe"

' Zip the file

Zip1.FileStore.Zip "c:\temp\zipped.zip"

End Sub

Private Sub Zip1_Progress(ByVal Status As DartZipCtl.ZipStatusConstants, ByVal file As DartZipCtl.IFile, ByVal FileNumber As Long, ByVal FileBytes As Long, ByVal TotalBytes As Long)

' Display the current operation

Label2.Caption = "Current Operation: " & Status

' Progress event has been raised, display the # of bytes processed only if it is

' currently zipping

If Status = zipZipping Then

Label1.Caption = "Completed " & FileBytes

End If

End Sub


Zipping/Unzipping To/From a Buffer

The PowerTCP Zip Compression Tool allows a great deal of interoperability with buffers. You can zip data contained in a buffer into a zip file, you can unzip data contained in a buffer, you can even zip/unzip from a buffer to a buffer. The ability to do this adds a great deal of flexibility and has a lot of benefits, one of which is the ability to interoperate directly with the PowerTCP product line (see the "Zip Control PowerTCP Product Interop" topic for more information.)

Example 1: Zipping data contained in a buffer.

This example demonstrates getting the text from a text box into a buffer, then zipping the buffer.

' Declare a DartStream to manage the buffer

Dim stream As New DartStream

' Write the data contained in the testbox to the stream

stream.Write Text1.Text

' Add the stream to the FileStore, since the stream does not have a name it

' is automatically named stream1

Zip1.FileStore.Add stream

' Change the name of the file which contains the data in the stream to

' something meaningful

Zip1.FileStore(1).Name = "mystream.txt"

' Zip the file. The data in the stream is now contained in a file called "mystream.txt"

' in the compressed file "zippedstream.zip"

Zip1.FileStore.Zip "c:\temp\zippedstream.zip"

Example 2: Loading a zip file and unzipping into a collection of streams.

This example demonstrates loading a compressed file and unzipping it into a collection of buffers. You can then manipulate the buffers however you like (the following example simply displays one of the buffers in a text box).

' Create a collection of streams to manage the buffers

Dim streams As New DartStreams

' Load a zip file containing several files into the FileStore

Zip1.FileStore.Load "C:\temp\zipstuff.zip"

' Unzip the compressed files into the streams

Zip1.FileStore.Unzip streams

' Display a stream in a textbox

Text1.Text = streams(1).ReadString


Zip Control Interop Example

The Zip Control was created to created both to work alone, and to interoperate with other PowerTCP products through the use of DartStream technology.

The following examples demonstrate interoperability between the Zip Control and the WebASP control.

Example 1: Grabbing a file from the Internet using the WebASP Control, then zipping and saving using the Zip Control

Private Sub Command1_Click()

On Error GoTo onError

WebASP1.Timeout = 30000

'Specify file to be retrieved and zipped.

WebASP1.Request.Url = "www.test.com/files/biggraphic.bmp"

'Get the file.

WebASP1.Get

'Check for good response from the server.

If WebASP1.Response.Status = 200 Then

'The file was retrieved, add it to the FileStore

Zip1.FileStore.Add WebASP1.Response.Body

'Zip and save the file

Zip1.FileStore.Zip "C:\ZippedInternetFiles\biggraphic.zip"

End If

Exit Sub

onError:

Debug.Print Err.Number & ":" & Err.Description

End Sub

Example 2: Zipping a file then using the WebASP Control's Put method to store it on the server.

Private Sub Command1_Click()

On Error GoTo onError

' Clear Request content

WebASP1.Request.Content = ""

WebASP1.Request.Version = webHTTP11

' Set path to put file in

WebASP1.Request.Url = "www.test.com"

WebASP1.Request.UrlPath = "Upload/testfile.bmp"

' Add file to the FileStore

Zip1.FileStore.Add ("tempfile.bmp")

'Zip the file, specifying the request body of the WebASP Control as the destination

Zip1.FileStore.Zip (WebASP1.Request.Body)

'Put the zipped file onto the server

WebASP1.Put

If WebASP1.Response.Status = 200 Then

Debug.Print "File successfully Put"

End If

onError:

Debug.Print Err.Number & " : " & Err.Description

End Sub


Zip Control

Properties Methods Events Constants Example

Product Notes

File integrity verification occurs whenever a zip file is accessed. If a problem is detected, the Zip Control will attempt to correct the problem automatically in order to preserve data. The result of this correction will result in either an Error if the file cannot be salvaged or a Warning if the file could be salvaged, but may be partially corrupt.

A compression-level choice is not provided with the control, as the algorithm implemented with the PowerTCP Zip Compression Tool will carry out high-level compression at high speed, unlike other zip compression products.

Along with the standard zip support on the Windows platform; the Zip Compression Tool supports the gzip format for the UNIX platform.

Miscellaneous

Product | PowerTCP Zip Compression Tool
Prog ID | DartZip.Zip.1
File | DartZip.dll
Dependencies | DartSock.dll
Threading | Apartment Model
Licensed | Yes


Algorithm Property

The compression algorithm that is used for the control.

Syntax

Object.Algorithm

Part | Description
Object | Evaluates to a Zip Control

Data Type

AlgorithmConstants

Remarks

Defaults to zipDeflate. The zip compression algorithm based on RFC 1951.

This property designates the algorithm used for any compression and decompression activities.


BackgroundOperation Property

Example

Specifies whether compression operations are synchronous or asynchronous.

Syntax

Object.BackgroundOperation

Part | Description
Object | Evaluates to a Zip Control

Data Type

BackgroundOperationConstants

Remarks

Defaults to zipNone.

This property controls whether operations such as Zip, Unzip, QuickZip, and QuickUnzip, are conducted synchronously, waiting for the process to finish before executing the next line of code, or asynchronously, implementing the process on a separate thread and immediately executing the next line of code.

Asynchronous operation can be configured to use different levels of CPU utilization. Any value greater other than zipNone designates asynchronous, or background, operation. The recommended setting for asynchronous is zipNormal. Any value greater than zipAboveNormal will use very high levels of CPU utilization, potentially stopping all other activity on the system.

Note: that the only way to identify that an asynchronous action has finished is to place code in the Progress event. The intended use of this functionality is to enable your code to process while the Zip Control is executing. If the control is attempting a zip or unzip operation and another call is made to conduct another zip or unzip operation, a zipBusy error will result.

To conduct multiple compression operations simultaneously, you should instantiate multiple versions of the Zip Control either using a control array or dynamic instantiation.

When set to zipNone and you are building an interactive desktop application, the DoEvents property should be set to True so that user-interface message events are processed.


DoEvents Property

Example

Allows for the processing of application message events when BackgroundOperation is False.

Syntax

Object.DoEvents

Part | Description
Object | Evaluates to a Zip Control

Data Type

Boolean

Remarks

Defaults to True.

If this control is used in a scripting environment such as IIS, the recommended value is False. When the BackgroundOperation property is True, this property has no effect (message events are not processed when the control us used asynchronously).


FileStore Property

Example

The object that is used for fine-tuned zip, unzip, and file manipulation functionality.

Syntax

Object.FileStore

Part | Description
Object | Evaluates to a Zip Control

Data Type

FileStore

Remarks

The FileStore property is used when you need to control the zip and unzip process down to the file level. For quick operations based on single files or wildcards, the QuickZip and QuickUnzip methods can be used. The FileStore object will be initialized whenever a zip or unzip operation takes place.

TotalBytes can change if files in the FileStore change in size after they have been added to the FileStore. To assure accurate reporting, files should not be changed after they have been added to the FileStore.


ProgressSize Property

Example

Sets when the Progress event will be raised based on the number of kilobytes compressed or decompressed.

Syntax

Object.ProgressSize

Part | Description
Object | Evaluates to a Zip Control

Data Type

Integer

Remarks

Defaults to 1024. This value is in units of kilobytes (kB).

This property can be used to control how often the Progress event is raised. For high efficiency, 1024 (1 megabyte) is the default value. For maximum processing speed, the Progress event can be turned off by using a value of 0. The upper limit for this value is 32767 (32 megabytes), the minimum non-zero value is 32. A value outside of this range will cause a run-time error.

ProgressSize effects the performance of the zip compression algorithm. The ideal size for high performance on 9x machines is 512, and the ideal size on NT/2000 machines is 4096. The default of 1024 will work very near the optimal level for both.


Abort Method

Example

Aborts any method and releases all resources.

Syntax

Object.Abort

Part | Description
Object | Evaluates to a Zip Control

Remarks

This method can be used at any time to stop an operation. When the BackgroundOperation property is True (or the BackgroundOperation property is False while the DoEvents property is True), user interface messages are processed allowing the Abort method to stop operation. For example, a command button can be placed on a form that would stop operation by calling the Abort method in the Click event. Alternatively, the Abort method can be called from within any Zip Control event to stop operation.


About Method

Show the About Box.

Syntax

Object.About

Part | Description
Object | Object expression that evaluates to a Zip Control.


QuickUnzip Method

Example

Extract from a compressed file into a specified location.

Syntax

Object.QuickUnzip (Source, Destination, PreservePath, [Password], [OverWrite])

Part | Description
Object | Evaluates to a Zip Control
Source | String. The file to decompress
Destination | String. The directory where the files will be stored.
PreservePath | Boolean. Specifies whether to preserve the directory structure.
Password | Optional String. The value representing the password.
OverWrite | Boolean. Specifies whether to overwrite existing files.

Remarks

This method is used when individual file manipulation is not required. If a password is required, but not provided, a zipPasswordRequired error will be raised.

During this operation, the Progress event will be raised in the frequency specified by the ProgressSize property of the Zip Control.The FileStore property will be populated with the files processed during this operation.

The OverWrite parameter defaults to False.

Error Codes

The QuickUnzip method may generate the following error codes (refer to the ZipErrorConstants topic for a complete list of error codes):

  • zipBusy

  • zipPasswordRequired

  • zipImproperZipFile

  • zipOutofSpace

  • zipWriteError

  • zipFileNotFound

  • zipReadError

Warning Messages

The possible warning messages that will be populated in the WarningText property. A warning will trigger a zipWarning error when the method completes:

  • Security Unsupported

  • Incorrect File Count

  • Incorrect CRC

  • Improper Header

  • File Could Not be Opened for Reading


QuickZip Method

Example

Compress a file or a group of files.

Syntax

Object.QuickZip (Source, Destination, IncludeSubs, PreservePath, [Password], [Encryption])

Part | Description
Object | Evaluates to a Zip Control.
Source | String. Specifies a file or a list of files that will be compressed. Wildcards can be used.
Destination | String. The name and location of the compressed file.
IncludeSubs | Boolean. Specifies whether to include subdirectories when using wildcards.
PreservePath | Boolean. Specifies whether to preserve the directory structure.
Password | Optional String. The value representing the password.
Encryption | Optional EncryptionConstants. The encryption mechanism for the file.

Remarks

This method is used when individual file control is not required.

During this operation, the Progress event will be raised in the frequency specified by the ProgressSize property of the Zip Control.

Any password protection is based upon the Password and the Encryption parameters. If a password is provided and the Encryption parameter is not set, the encryption mechanism will default to zipStandard. Currently only zipStandard is available.

Use this method to compress multiple files based on wildcards, file lists, or entire branches of a directory tree. The FileStore property will be populated with the files processed during this operation.

The following table shows some examples of wildcards:

Wildcard | Meaning
* | Compress all files in the directory and the subdirectories.
*.* | Compress all files in the directory that contain a "." in the filename.
*.txt | Compress all files in the directory with filenames that end with ".txt".
Test* | Compress all files or directories in the directory with filenames that begin with "Test"
*Test* | Compress all files or directories in the directory that contain "Test" in the filename.

Wildcards will include subdirectories when the IncludeSubs parameter is True.

You may use a mixture of filenames and wildcards for Source. Multiple files should be separated by commas (no spaces). Filenames and wildcards may contain full paths, such as /Test/test.txt or /Test/*.txt. If a file in the file list specified by Source does not exist then an error is generated. When using mixtures of different wildcards and names, it is possible to have duplicate entries.

Error Codes

The QuickZip method may generate the following error codes (refer to the ZipErrorConstants topic for a complete list of error codes):

  • zipBusy

  • zipPasswordRequired

  • zipEncryptionRequired

  • zipOutofSpace

  • zipWriteError

  • zipFileNotFound

Warning Messages

The possible warning messages that will be populated in the WarningText property. A warning will trigger a zipWarning error when the method completes:

  • Improper Write Termination

  • Security Unsupported

  • File Could Not be Opened for Reading


Disk Event

Example

Raised when a new disk is needed during a spanning process.

Syntax

Private Sub Object_Disk ([Index as Integer,] DiskNeeded as Integer)

Part | Description
Object | Evaluates to a Zip Control
Index | Integer. Array index if the object is part of an array.
DiskNeeded | Integer. The disk number needed during a spanning operation. The number starts at 1.

Remarks

If the zip file is being spanned to removable media or being read from removable media, the event is designed to provide notification for the needed volume. If the proper volume is not inserted, the notification will repeat unless the Abort method is called, in which case the process will cease operation. Any removable media is expected to be formatted. Any existing files on the target media will be ignored, but the volume information will be overwritten. If the targeted media does not have enough drive space or is not formatted, the disk event will repeat until a disk of the correct size is inserted or the operation is aborted. Any file containing the same name on the target media will be overwritten.

When this event fires with a disk number of 0, the current disk has been identified as a spanned zip disk, but it is not the last disk in the archive. The last disk in the spanned archive must be inserted for zip operations to continue.

To maintain compatibility with PKzip, spanned disks will be renamed automatically.

Error Codes

  • zipInvalidMedia

  • zipOutOfSpace


Error Event

Example

Raised when an error or warning condition occurs.

Syntax

Private Sub Object_Error ([Index as Integer,] Number as ZipErrorConstants, Description as String)

Part | Description
Object | Evaluates to a Zip Control
Index | Integer. Array index if the object is part of an array.
Number | ZipErrorConstants. The numeric assignment for the error
Description | String. The description for the error.

Remarks

Some environments, such as IIS Active Server Pages, do not support event handling. In this case, the application must rely on blocking and the Error object that is thrown to the container when an error condition occurs.

When an operation is underway and the BackgroundOperation property is True, warnings and errors can only be detected in the Error event. If BackgroundOperation is False, warnings and errors will also be thrown in the container that triggered the error or warning condition. The major distinction between a warning and an error is that errors are fatal to an operation while warnings signify that a problem occurred but the operation was able to complete successfully. An error will be triggered as soon as a problem is detected while a warning will only be triggered at the end of an operation.

A compression or decompression operation can also result in a warning. Warnings are identified with a zipWarning error message. Unlike an error, warnings result when a problem has been detected, but the operation can still be completed. Often, warnings will be a sign of possible data corruption. The Zip Control will attempt to correct any problems identified in a compressed file, but that is no guarantee that data will be properly preserved. When a warning is thrown, the warning message will identify which compressed files are corrupted. The list of warnings for an individual file can be viewed in the WarningText property.


Progress Event

Example

Raised periodically to indicate compression or decompression activity.

Syntax

Private Sub Object_Progress ([Index as Integer,] Status as ZipStatusConstants, File as File, FileNumber as Long, FileBytes as Long, TotalBytes as Long)

Part | Description
Object | Evaluates to a Zip Control
Index | Integer. Array index if the object is part of an array.
Status | ZipStatusConstants. The status of the current process.
File | File. The current file being processed.
FileNumber | Long. The current number of the file being processed in the collection.
FileBytes | Long. The cumulative number of uncompressed bytes processed for a particular file.
TotalBytes | Long. The cumulative number of uncompressed bytes processed for all files.

Remarks

During this operation, the Progress event will be raised in the frequency specified by the ProgressSize property of the Zip Control.

When the QuickZip and QuickUnzip methods are called, the FileStore property will automatically be populated and the internal statistics of the file will be available in this event.

The total bytes to be processed for a particular file is available in the Size property of the File object while the total bytes to be processed for the entire collection is available in the TotalBytes property of the FileStore property.

If the value in FileBytes or TotalBytes will exceed 2 gigabytes, the return value will be a negative number, as the operating system does not allow a value greater than 2147483647 to be represented as a long. The recommendation for reading the actual value is to create a Double data-type by adding 4294967296 to the returned negative values.

If the FileNumber is 0, the zip or unzip process has either just begun or completed. If the Extract method is in use, the FileNumber will represent the File item extracted.

The File parameter could be null, for example if the Status is zipBeginZip.

TotalBytes can change if files in the FileStore change in size after they have been added to the FileStore. To assure accurate reporting, files should not be changed after they have been added to the FileStore.

With QuickZip, Zip ,QuickUnzip, and Unzip, the first and last Progress events fired have File set to Nothing, 0 for the FileNumber, 0 for the FileBytes, and 0 for the TotalBytes.


Algorithm Constants

Value | Constant | Description
0 | zipDeflate | The zip compression algorithm based on RFC 1951.


BackgroundOperation Constants

Value | Constant | Description
0 | zipNone | No background operation. Control operation is purely synchronous.
1 | zipLowest | Lowest background operation priority. Control operation is asynchronous, but separate thread receives limited CPU processing.
2 | zipLow | Low background operation priority. Control operation is asynchronous, but separate thread receives low CPU processing.
3 | zipNormal | Normal background operation priority. Control operation is asynchronous, but separate thread receives normal CPU processing. (Recommended)
4 | zipAboveNormal | Above normal background operation priority. Control operation is asynchronous, but separate thread receives above normal CPU processing.
5 | zipHighest | Highest background operation priority. Control operation is asynchronous, but separate thread receives most of the CPU processing.
6 | zipCritical | Time critical background operation priority. Control operation is asynchronous, but separate thread receives ALL CPU processing.


Encryption Constants

Value | Constant | Description
0 | zipNoEncryption | No encryption.
1 | zipStandard | Standard zip encryption.


ZipError Constants

Design-Time Errors

Value | Constant | Description
12001 | zipInvalidParam1 | Parameter #1 is invalid.
12002 | zipInvalidParam2 | Parameter #2 is invalid.
12003 | zipInvalidParam3 | Parameter #3 is invalid.
12004 | zipInvalidParam4 | Parameter #4 is invalid.
12009 | zipInvalidProperty | Invalid property assignment.

Run-Time Errors

Value | Constant | Description
0 | zipNoError | No Error.
13001 | zipImproperZipFile | The file is not identified as a compliant zip file.
13002 | zipBusy | The current instance of the Zip Control is already running an operation.
13003 | zipImproperEOF | The End-Of-File location does not match the headers.
13004 | zipImproperSpanSize | The current zip file cannot be spanned for lack of available space on the target device.
13005 | zipPasswordRequired | The Encryption property has a value other than zipNoEncryption and an operation was conducted without providing a password.
13006 | zipEncryptionRequired | The Encryption property has a value of zipNoEncryption while password protection was requested.
13007 | zipUnknownAlgorithm | The encryption algorithm used is not recognized by this DLL
13008 | zipSizeError | The resulting file is larger than 4GB
13009 | zipInvalidPassword | The password given is invalid. This error will on rare occasion be replaced by zipInvalidZipFile.
13010 | zipNotRemovable | The drive specified is not removable, but the SpanSettings specify removable spanning.

Run-Time Warnings

Value | Constant | Description
13501 | zipWarning | While the process completed, a problem was detected. Please access the FileStore property to verify errors with the following files:

Additional Zip Errors

Value | Constant | Description
12023 | zipFileOpen | The specified file has been opened by another application.
12025 | zipOutofSpace | The targeted device does not have enough space to create the file.
12026 | zipWriteError | An unexpected error occurred while writing to the disk.
12027 | zipReadError | An unexpected read error occurred while reading from a disk.
12028 | zipFileNotFound | The specified file was not found.
12028 | zipInvalidDirectory | The specified directory was not found.
12029 | zipInvalidMedia | The specified media does not exist or is not ready for writing.

Remarks

When an operation is underway and the BackgroundOperation property is True, warnings and errors can only be detected in the Error event. If BackgroundOperation is False, warnings and errors will also be thrown in the container that triggered the error or warning condition. The major distinction between a warning and an error is that errors are fatal to an operation while warnings signify that a problem occurred but the operation was able to complete successfully. An error will be triggered as soon as a problem is detected while a warning will only be triggered at the end of an operation. Warnings often indicate potential corruption in the zip file and the data integrity may be compromised. The Zip Control will always attempt to fix the data on the fly if the anything is deemed corrupt. If a warning is thrown, the warning message will include the names of the problem files. To see the actual warning Description, please see the individual file that is represented by the File object. The read-only property WarningText will have the associated information.


ZipStatus Constants

Value | Constant | Description
0 | zipBeginZip | Started the zip compression
1 | zipZipping | Compressing data.
2 | zipEndZip | Finished the zip compressing
3 | zipBeginUnzip | Begin the zip decompressing
4 | zipUnzipping | Decompressing data.
5 | zipEndUnzip | Finished the zip decompressing.
6 | zipTesting | Testing the compressed file
7 | zipFixing | Attempting to fix a corrupted file
8 | zipAdding | Adding files to the FileStore.


DartStream Object

Properties Methods Constants Example

Use the DartStream Object to manage a streamed buffer to/from memory or a file.

Miscellaneous

Product | All PowerTCP Tools
Prog ID | Dart.DartStream.1
Create | Yes
File | DartSock.dll
Dependencies | None
Threading | Apartment Model
Licensed | No


DeleteOnDestroy Property

Example

Specifies if the corresponding file should be deleted when the object is destroyed.

Syntax

Object.DeleteOnDestroy

Part | Description
Object | Evaluates to a DartStream object.

Data Type

Boolean

Remarks

WARNING USE WITH CAUTION!

When set to True and FileName specifies a file, the file is deleted when this object is destroyed.


FileMode Property

How the file is to be created or opened.

Syntax

Object.FileMode

Part | Description
Object | Evaluates to a DartStream object.

Data Type

FileModeConstants

Remarks

Set this property prior to changing FileName to determine how the file is created.


FileName Property

Example

Intended name of the file.

Syntax

Object.FileName

Part | Description
Object | Evaluates to a DartStream object.

Data Type

String

Remarks

When set to a file name, the file is opened. When set to an empty string, the file is closed.

When set to an empty string and then changed to a file name, a file is created or opened according to FileMode. If an existing file is opened, the value of the Size property determines how the file is treated:

  • If Size = 0 when the file is opened, it is assumed the file is being opened for reading, and Size is set to the size of the file.

  • If Size > 0 when the file is opened, it is assumed the file is being opened for writing, and the existing contents of the file are replaced.

When set to a file name and then changed to an empty string, all data in the file is buffered to memory and the file is closed.

When set to a file name and then changed to a different file name, the file is moved to the new location. If FileMode = createUnique, an existing file cannot be unintentionally overwritten.

You can delete a file only by setting this property to an existing file name, setting FileMode to createOpen or createExisting, setting DeleteOnDestroy to True, and allowing the DartStream object to be destroyed.


Position Property

Example

Current byte position in the stream.

Syntax

Object.Position

Part | Description
Object | Evaluates to a DartStream object.

Data Type

Long

Remarks

The Read and Write methods use this starting position. This property can be set to any value between 0 and Size. Position is initialized to 0 when the buffer is empty.


Ref Property

Stores a reference to another object, data type, or value.

Syntax

Object.Ref

Part | Description
Object | Evaluates to a DartStream object.

Data Type

Variant

Remarks

This property is available only at run time.

Use this property to associate the control with any Variant. If the data type is String, Ref stores a copy of the string. If the data type is a Byte array, it stores a copy of the Byte array. If the data type is an object, it increases the reference count of the object.

When Object is destroyed, and Ref holds an object reference, that object's reference count is decremented.


Size Property

Example

Size of the stream in bytes.

Syntax

Object.Size

Part | Description
Object | Evaluates to a DartStream object.

Data Type

Long

Remarks

Read-only.


UniqueName Property

Name of the file currently open.

Syntax

Object.UniqueName

Part | Description
Object | Evaluates to a DartStream object.

Data Type

String

Remarks

Read-only.

This property is usually the same as FileName, but is different when FileMode property is createUnique and FileName already exists. In this case, a period and a number (starting at 1) is appended to FileName and saved as this property.


Clear Method

Example

Clear the stream.

Syntax

Object.Clear

Part | Description
Object | Evaluates to a DartStream object.

Remarks

WARNING USE WITH CAUTION!

This method sets Size and Position to 0. ALL DATA IS PERMANENTLY LOST!

Error Codes

The Clear method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

  • ptInvalidParam1

  • ptInvalidParam2

  • ptNoBufferSpace


Read Method

Example

Read one or more bytes from the stream. Reading starts at the Position property. Set Position to change the position.

Syntax

ReturnCount = Object.Read Buffer [ , Count ]

Part | Description
Object | Evaluates to a DartStream object.
Buffer | Uninitialized String or Byte Array. Where data is to be put.
Count | Optional Long. Specifies how much data is to be read.
ReturnCount | Returned Long. Indicates how much data was read.

Remarks

If the Buffer parameter is omitted, then this method attempts to read all the data from the current position to the end of the stream. The position is advanced Count bytes upon completion.

Error Codes

The Read method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

  • ptInvalidParam1

  • ptInvalidParam2

  • ptNoBufferSpace


ReadBytes Method

Example

Return data from the current position as a Byte Array. Reading starts at the Position property. Set Position to change the position.

Syntax

Data = Object.ReadBytes [ Count ]

Part | Description
Object | Evaluates to a DartStream object.
Count | Optional Long. Specifies how much data is to be read.
Data | Returned Byte Array. Indicates how much data was read.

Remarks

Some environments, such as JavaScript, do not support the passing of parameters by reference. Consequently, such methods as Receive cannot be used by passing in a String. You can use the DartStream object to circumvent this limitation (see the ReadString method Remarks section for a Java sample).

Error Codes

The ReadBytes method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

  • ptInvalidParam1

  • ptInvalidParam2

  • ptNoBufferSpace


ReadString Method

Example

Return data from the current position as a String. Reading starts at the Position property. Set Position to change the position.

Syntax

Data = Object.ReadString [ Count ]

Part | Description
Object | Evaluates to a DartStream object.
Count | Optional Long. Specifies how much data is to be read.
Data | Returned String. Indicates how much data was read.

Remarks

Some environments, such as JavaScript, do not support the passing of parameters by reference. Consequently, such methods as Receive cannot be used by passing in a String. You can use the DartStream object to circumvent this limitation, as shown in the following Java sample:

<% @LANGUAGE="JScript"%>

<%

var Tcp = Server.CreateObject("Dart.Tcp.1");

Tcp.TimeOut = 30000;

Tcp.Connect("www.microsoft.com", 80);

Tcp.Send("GET / HTTP/1.0\r\n\r\n");

var Stream = Server.CreateObject("Dart.DartStream");

while(Tcp.State != 0)

Tcp.Receive(Stream);

Stream.Position = 0;

Response.Write(Stream.ReadString());

%>

Error Codes

The ReadBytes method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

  • ptInvalidParam1

  • ptInvalidParam2

  • ptNoBufferSpace


Write Method

Example

Write one or more bytes to the stream. Writing starts at the Position property. Set Position to change the position.

Syntax

ReturnCount = Object.Write Buffer [ , Count ]

Part | Description
Object | Evaluates to a DartStream object.
Buffer | Initialized String or Byte Array. Where data is being written from.
Count | Optional Long. Specifies how much data is to be written.
ReturnCount | Returned Long. Indicates how much data was written.

Remarks

If the Count parameter is omitted, then this method writes the entire contents of the Buffer parameter. After the data is written the Position is advanced Count bytes.

Error Codes

The Write method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

  • ptInvalidParam1

  • ptInvalidParam2

  • ptNoBufferSpace


FileModeConstants

Enumerates values of the FileMode property:

Value | Constant | Description
0 | createAlways | If the file exists, replace the file. If the file does not exist, create the file.
1 | createExisting | If the file exists, open the file. If the file does not exist, throw an error.
2 | createUnique | If the file exists, create a file with a unique name (a period and a number are appended to the filename). If the file does not exist, create the file.
3 | createOpen | If the file exists, open the file. If the file does not exist, create the file.


DartStreams Object

Properties Methods

Collection of DartStream Objects.

Miscellaneous

Product | All PowerTCP Tools
Prog ID | Dart.DartStreams.1
Create | Yes
File | DartSock.dll
Dependencies | None
Threading | Apartment Model
Licensed | No


Count Property

Number of objects in the collection.

Syntax

Object.Count

Part | Description
Object | Evaluates to a DartStreams object.

Data Type

Long

Remarks

Read-only.


Add Method

Example

Add a DartStream object to the collection.

Syntax

Position = Object.Add Stream

Part | Description
Object | Evaluates to a DartStreams object.
Stream | DartStream object to be added to the collection.
Position | New value of the Position property.

Error Codes

The Add method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

  • ptInvalidParam1

  • ptInvalidParam2

  • ptNoBufferSpace


Clear Method

Remove all the objects from the collection.

Syntax

Object.Clear

Part | Description
Object | Evaluates to a DartStreams object.

Remarks

This method takes linear (O(n)) time, where n is the number of items stored.


Item Method

Example

Set or return a DartStream object based on an index.

Syntax

Value = Object.Item Index

Part | Description
Object | Evaluates to a DartStreams object.
Index | Long. Indicates position in collection to return.
Value | DartStream object

Error Codes

The Item method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

  • ptInvalidParam1

  • ptInvalidParam2

  • ptNoBufferSpace


Remove Method

Remove a DartStream object from the collection based on an index.

Syntax

Value = Object.Remove Index

Part | Description
Object | Evaluates to a DartStreams object.
Index | Long. Indicates position in collection to be removed.
Value | DartStream object removed from the collection.

Error Codes

The Remove method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

  • ptInvalidParam1

  • ptInvalidParam2

  • ptNoBufferSpace


DartStrings Object

Properties Methods

Collection of strings. The DartStrings Object is used as a supporting formatting object for several PowerTCP objects and controls.

Miscellaneous

Product | PowerTCP Zip Compression Tool
Prog ID | Dart.DartStrings.1
File | DartSock.dll
Dependencies | None
Threading | Apartment Model
Licensed | No


DartStrings Object Usage

The DartStrings Object adds some useful enhancements for string manipulation. It is most commonly used in PowerTCP as a formatting object that can easily carry out some basic manipulations, but it can also be used for other purposes. The Add and Clear methods are fast, taking linear (O(n)) time based on the number of strings (n = # of strings), as does the All property. The Delimiter method takes constant time, so any overhead related to it can usually be ignored. This performance and functionality enables some useful operations. For example, by combining the Delimiter property, Add method and All property, a rapid find/replace of any string to any string can be carried out on large files. Additionally, Dartstrings provides this capability for wide characters, so that these manipulations can be done in many different languages, not just ASCII.

This example VB find/replace code shows the power of the Dartstrings (and Dartstream). It took 500 milliseconds to replace spaces with carriage return/line feeds in a 1.12MB file of email addresses (reading from in, writing to out), including the time required by file I/O. This is about 50 times as fast as Word and Notepad, and can be done with arbitrary strings by changing the delimiter values used.

Option Explicit

Private Sub Command1_Click()

On Error GoTo OnError

Command1.Enabled = False

Dim Stream As New DartStream

Stream.FileMode = createExisting

Stream.FileName = App.Path + "\in.txt"

Dim Strings As New DartStrings

Strings.Delimiter = Space(1)

Strings.Add Stream.ReadString

Dim Stream2 As New DartStream

Stream2.FileMode = createAlways

Stream2.FileName = App.Path + "\out.txt"

Strings.Delimiter = vbCrLf

Stream2.Write Strings.All

GoTo Done

OnError:

Debug.Print "ERROR #" + CStr(Err.Number) + ": " + Err.Description

Done:

Command1.Enabled = True

End Sub


All Property

Concatenates and returns all the strings in the collection. The Delimiter string is inserted between each string in the collection.

Syntax

Object.All

Part | Description
Object | Evaluates to a DartStrings object.

Data Type

String

Remarks

Read-only. For example, if the Delimiter is ":" and the strings in the collection are "ab", "cd", and "ef", then this property returns "ab:cd:ef".

The All property takes linear (O(n)) time for strings of less than 50kB, and 0(n*size/50kB) for longer strings, where n is the number of independent strings and size is the size of the resultant string in kB. The method used is about 50-100 times as fast as most similar techniques in use today.


Count Property

Number of objects in the collection.

Syntax

Object.Count

Part | Description
Object | Evaluates to a DartStrings object.

Data Type

Long

Remarks

Read-only.


Delimiter Property

Separates a string into substrings when adding a string to the collection with the Add method. Also used as a separator when reading the All property.

Syntax

Object.Delimiter

Part | Description
Object | Evaluates to a DartStrings object.

Data Type

String

Remarks

Read-only. The default value is empty ("").

This Delimiter property takes constant time to get or set.


Item Property

Returns or sets a string in the collection.

Syntax

Value = Object.Item ( Index )

Object.Item ( Index ) = Value

Part | Description
Object | Object expression that evaluates to a DartStrings object.
Index | String or Long. Specifies a substring to search for or an index into the collection.
Value | String.

Data Type

The string found in the collection or an empty string if none is found.

Remarks

When Index is a Long, its value must be between one and the collection's Count property. When specifying Index as a String, the first string in the collection matching all the characters of the substring is returned (strings are compared starting with the leftmost character, and are case-insensitive).

This is a parameterized property instead of a (read-only) method so that it can be used to set a value.

Error Codes

The Add method may generate the following error code (refer to the ErrorConstants topic for a complete list of error codes):

ptInvalidParam1 (When reading the property, Index is not a Long or String. When setting the property, Index is not a Long between 1 and Count or the sub-string is not found.)


Add Method

Add one or more strings to the collection.

Syntax

Object.Add Item [ , Index ]

Part | Description
Object | Object expression that evaluates to a DartStrings object.
Item | String. What is added to the collection.
Index | Optional Long. Defaults to the end of the collection. Specifies where in the collection the string should be inserted. If multiple substrings are added, then they will start at this index. Should be at least 1 and no greater than 1 more than the Count property.

Remarks

Item is parsed for the Delimiter, and is segmented into substrings if found. All substrings are added as individual strings to the collection.

For example, if the Delimiter is ":" and Item is "ab:cd:ef", then "ab", "cd", and "ef" are added.

The Add method takes linear (O(n)) time, where n is the number of delimited strings being added.

Error Codes

The Add method may generate the following error code (refer to the ErrorConstants topic for a complete list of error codes):

ptInvalidParam2 (Index is not between 1 and Count + 1)


Clear Method

Remove all the objects from the collection.

Syntax

Object.Clear

Part | Description
Object | Evaluates to a DartStrings object.

Remarks

This method takes linear (O(n)) time, where n is the number of items stored.


Find Method

Return a string from the collection where the beginning substring matches the specified string. The string comparison is case-insensitive, starting with the leftmost character.

Syntax

Value = Object.Find SubString [ , StartAfter ]

Part | Description
Object | Object expression that evaluates to a DartStrings object.
SubString | String. The substring to match. Matching starts with the first character.
StartAfter | Optional Long. Defaults to 0. On input, it contains the index in the collection after which to start the search. On return, it is updated to the index of the string returned by Find. If no string is found, StartAfter is set to 0.
Value | String. Returns the string found or "" if none was found.

Remarks

When specifying StartAfter, use an index between 0 and one less than the collection's Count property. Specifying a value of 0 (the default) starts with the first string in the collection.

Error Codes

The Find method may generate the following error code (refer to the ErrorConstants topic for a complete list of error codes):

ptInvalidParam2 (StartAfter is not between 0 and Count - 1)


Remove Method

Remove a string from the collection.

Syntax

[ Value = ] Object.Remove Index

Part | Description
Object | Object expression that evaluates to a DartStrings object.
Index | String or Long. Specifies a substring to search for or an index into the collection.
Value | String. Returns a copy of the string removed.

Remarks

When Index is a Long, it must be between one and Count. When Index is a string, the first string in the collection matching all the characters of the specified substring is returned (both strings are compared starting with the left-most character and is case insensitive).

Error Codes

The Remove method may generate the following error code (refer to the ErrorConstants topic for a complete list of error codes):

ptInvalidParam1 (Index is not a Long or String)


File Object

Properties Methods

The object is a representation of an individual file in the FileStore property. This information is read from the file information made available either by the operating system or from the central directory in a zip file. If the file information is acquired from a Load method, the file itself will only be extracted when the Unzip method is called.


Attributes Property

Example

The attributes for the file.

Syntax

Object.Attributes

Part | Description
Object | Evaluates to a File object.

Data Type

FileAttributes

Remarks

File attributes settings consist of ReadOnlyFile, HiddenFile, SystemFile, ArchiveFile, NTCompressedFile, and NTEncryptedFile. Certain attributes will not extract unless they are on a Windows NT/2000/XP based platform. In cases such as this, the attributes will be null.


Comments Property

Example

Comments that are associated with the current file.

Syntax

Object.Comments

Part | Description
Object | Evaluates to a File object.

Data Type

String

Remarks

None.


CompressedSize Property

Example

The compressed file size.

Syntax

Object.CompressedSize

Part | Description
Object | Evaluates to a File object.

Data Type

Long

Remarks

Read-Only

This value is greater than 0 if the file has been compressed. Adding a file with the Add method will set the value to 0. The CompressedSize property can be utilized to check if a file is currently in a compressed state.


CRC Property

Example

The check-sum value for this file.

Syntax

Object.CRC

Part | Description
Object | Evaluates to a File object.

Data Type

Long

Remarks

Read-Only

The CRC property is obtained by performing a mathematical calculation on a block of data and returning a number that represents the content and organization of that data. This value is only available if the file has been compressed. Adding a file with the Add method will not produce a value.


DiskNumber Property

The location of the file if it is spanned across multiple volumes.

Syntax

Object.DiskNumber

Part | Description
Object | Evaluates to a File object.

Data Type

Integer

Remarks

Read-Only

The first volume of a spanned file is 1. If the value of the property is 0, the current file does not belong to a spanned set.


Encryption Property

Example

Specifies the encryption mechanism used on an encrypted File object.

Syntax

Object.Encryption

Part | Description
Object | Evaluates to a File object.

Data Type

EncryptionConstants

Remarks

Read-Only

This property is initialized when the FileStore is initialized with the Load method, the Encryption property can then be used to determine if a password will be required when conducting an unzip operation. If a single password is used to encrypt any or all the File objects, the Unzip method can be used to extract encrypted files. If the File objects are encrypted using multiple passwords, the Extract method must be used to decompress the individual items.


Modified Property

Example

The date/time the file was last modified.

Syntax

Object.Modified

Part | Description
Object | Evaluates to a File object

Data Type

Date

Remarks

Read-Only

The format of the information will be similar to “8/8/2001 4:38:03 PM”. The DATE data type is equivalent to a double, and is the fractional number of days since midnight December 30, 1899.


Name Property

Example

The name of the file.

Syntax

Object.Name

Part | Description
Object | Evaluates to a File object

Data Type

String

Remarks

This property is used along with the Path property to designate a unique entry in the FileStore object.


Path Property

Example

The directory location of the file.

Syntax

Object.Path

Part | Description
Object | Evaluates to a File object

Data Type

String

Remarks

This property is used along with the Name property to designate a unique entry in the FileStore object.


PercentCompressed Property

Example

The compression percentage of the file.

Syntax

Object.PercentCompressed

Part | Description
Object | Evaluates to a File object

Data Type

Integer

Remarks

Read-Only

The ratio is based on a number from 0 to 99 with 0 as no compression and 99 as maximum compression. This value is only available if the file has been compressed. Adding a file with the Add method will not produce a value.


Size Property

Example

The non-compressed size of the file.

Syntax

Object.Size

Part | Description
Object | Evaluates to a File object.

Data Type

Long

Remarks

Read-Only.


WarningText Property

Example

The description of the warning information available when a zipWarning error is thrown.

Syntax

Object.WarningText

Part | Description
Object | Evaluates to a File object

Data Type

DartStrings

Remarks

Read-Only

The default value is an empty DartStrings. This property will only be filled when a zipWarning error is thrown. The information provided in this property is presented as a collection with each warning representing one item in the collection. Thus, if there are three different warnings for this file, three separate items will be contained in the collection. If the collection is empty, the current file has no warning condition.

The possible items in the WarningText collection can include:

Text | Description
Incorrect File Count | The number of files in the zip file does not match the directory list .
Security Unsupported | Security attributes are not supported on the target operating system.
Incorrect CRC | The CRC value of file is not correct
Improper Header | The header information in the zip directory cannot be verified against the local header.
Read Warning | The file could not be opened for reading.


Extract Method

Example

Extract the compressed File object to media or a memory buffer.

Syntax

Object.Extract (Destination, [Password])

Part | Description
Object | Evaluates to a File object.
Destination | Variant. A directory location or a DartStream object.
Password | Optional String. Sets the password for an encrypted file or memory buffer.

Remarks

If the destination is media, any existing files with the same name will be overwritten. If the File object requires a password, the Password parameter must be set; otherwise, the zipPasswordRequired error will be thrown.

If this method is used on an uncompressed File object, the zipImproperZipFile error will occur.

During this operation, the Progress event will be raised in the frequency specified by the ProgressSize property of the Zip Control.

Error Codes

The Extract method may generate the following error codes (refer to the ZipErrorConstants topic for a complete list of error codes):

  • zipPasswordRequired

  • zipOutofSpace

  • zipWriteError

  • zipImproperZipFile

  • zipReadError

Warning Messages

The possible warning messages that will be populated in the WarningText property. A warning will trigger a zipWarning error when the method completes:

  • Incorrect CRC

  • Incorrect File Size


FileAttributes Object

Properties Example

The following properties are file attributes for a file represented by the File object.

Certain file attributes are operating system specific and may not be available for extraction or addition on certain platforms.


ArchiveFile Property

Example

The Archive attribute for a file.

Syntax

Object.ArchiveFile

Part | Description
Object | Evaluates to a FileAttributes object.

Data Type

Boolean

Remarks

For the Attribute property in the File object, this property will be True if the file is marked as Archive.


HiddenFile Property

Example

The Hidden attribute for a file.

Syntax

Object.HiddenFile

Part | Description
Object | Evaluates to a FileAttributes object.

Data Type

Boolean

Remarks

For the Attribute property in the File object, this property will be True if the file is marked as Hidden.


NTCompressedFile Property

Example

The Compressed attribute for a file on a Windows NT-based operating system.

Syntax

Object.NTCompressedFile

Part | Description
Object | Evaluates to a FileAttributes object.

Data Type

Boolean

Remarks

For the Attribute property in the File object, this property will be True if the file is marked as Compressed.

The Compressed attribute will not be included when a file is extracted on a non-Windows NT based system.


NTEncryptedFile Property

Example

The Encrypted attribute for a file on a Windows NT-based operating system.

Syntax

Object.NTCompressedFile

Part | Description
Object | Evaluates to a FileAttributes object.

Data Type

Boolean

Remarks

For the Attribute property in the File object, this property will be True if the file is marked as Encrypted.

The Encrypted attribute will not be included when a file is extracted on a non-Windows NT based system.


ReadOnlyFile Property

Example

The Read-Only attribute for a file.

Syntax

Object.ReadOnlyFile

Part | Description
Object | Evaluates to a FileAttributes object.

Data Type

Boolean

Remarks

For the Attribute property in the File object, this property will be True if the file is marked as Read-Only.


SystemFile Property

Example

The System attribute for a file.

Syntax

Object.SystemFile

Part | Description
Object | Evaluates to a FileAttributes object.

Data Type

Boolean

Remarks

For the Attribute property in the File object, this property will be True if the file is marked as System.


FileStore Object

Properties Methods Constants Example

This object is a collection of File objects and is exposed by the FileStore property in the Zip Control. The FileStore is automatically populated when the QuickZip, QuickUnzip, and Load methods are called. Files and buffers, which are represented by individual File objects, can be added using the Add method.

TotalBytes can change if files in the FileStore change in size after they have been added to the FileStore. To assure accurate reporting, files should not be changed after they have been added to the FileStore.

The FileStore object can be created and used independently from the Zip control. Such an independent FileStore object cannot fire events, but it can carry out all other operations on its own.


Count Property

Number of objects in the collection.

Syntax

Object.Count

Part | Description
Object | Evaluates to a FileStore object.

Data Type

Long

Remarks

Read-only.


Comment Property

The comment for a Zip File.

Syntax

Object.Comment

Part | Description
Object | Evaluates to a FileStore object

Data Type

String

Remarks

This is the comment for the entire Zip file.


Format Property

Example

Sets the zip header format for support of either the Microsoft operating systems or UNIX based Info-Zip.

Syntax

Object.Format

Part | Description
Object | Evaluates to a FileStore object

Data Type

FormatConstants

Remarks

Defaults to zipMicrosoft.

If the zip file is to be decompressed on a UNIX platform, setting this property to zipUNIX will insure that the headers are stored in a manner that is compatible with the UNIX platform.


PasswordRequired Property

Example

Specifies if a File object in the FileStore is encrypted.

Syntax

Object.PasswordRequired

Part | Description
Object | Evaluates to a FileStore object

Data Type

Boolean

Remarks

Read-Only

If this property is True, the Encryption property will identify the File object that requires a password. If more than one password is used to encrypt several File objects, the Extract method should be used. Otherwise, the Unzip method can be used for batch operations that require only one password.


TotalBytes Property

Example

The number of uncompressed bytes represented by the collection.

Syntax

Object.TotalBytes

Part | Description
Object | Evaluates to a FileStore object

Data Type

Long

Remarks

Read-Only


VolumeLabel Property

Example

The media volume label.

Syntax

Object.VolumeLabel

Part | Description
Object | Evaluates to a FileStore object

Data Type

String

Remarks

This property will be automatically populated during the Load operation if the information exists in the zip file. During a Zip operation, if this property has data it will be written to the target zip file. During an Unzip operation, if the property has data, the volume information will be written to the target media. This property will not effect unzipping to a DartStream.


Add Method

Example

Add a File object to the collection.

Syntax

Object.Add (Source, [IncludeSubs], [PreservePath], [Password], [Encryption]))

Part | Description
Object | Evaluates to a FileStore object.
Source | Variant. A string representing name and path of the file to add or a DartStream object.
IncludeSubs | Optional Boolean. Specifies whether to include subdirectories when using wildcards.
PreservePath | Optional Boolean. Preserve the directory structure of the specified file.
Password | Optional String. The value representing the password.
Encryption | Optional EncryptionConstants. The encryption mechanism for the file.

Remarks

This method will add an item to the FileStore collection. For every file or memory buffer added a File object will be created to represent the item and all information associated with the file/buffer that is either available from the operating system or the DartStream object. When the item is a DartStream, time stamps will default to the time when the data is added. Once an item has been added, accessing the associated File object in the FileStore property can be used for altering information. Adding an item to the FileStore property does not automatically execute a zip operation. The Zip method must be called to generate a compressed zip file or memory buffer.

If a file is added that already exists based on the combination of the Name property and the Path property of the File object, a second file will be added to the FileStore with the same information. This feature is included to enable archiving. If a DartStream is added, the Name property will have an automatically generated label of “Stream” plus an auto-incremented number (ex: Stream1, Stream2, etc.). The Name property can be changed after a memory buffer has been added, but the increment count does not reflect any name changes made in the FileStore. Thus, if “Stream3” has been added and the name is changed to “Stream4”, the next memory buffer added to the FileStore will have a Name value of “Stream4” and overwrite the previous item with a designation of “Stream4”. To assure that an item is not overwritten, change the Path property to a unique value if using the “Stream” + n naming convention.

To encrypt the file or memory buffer that is added to the FileStore, the Password and Encryption parameters will require values. If a password is provided but the Encryption value is zipNoEncryption, the zipEncryptionRequired error will be raised. If the Encryption parameter is anything but zipNoEncryption while the Password parameter has no value, a zipPasswordRequired error will be raised.

The PreservePath parameter defaults to True. If the PreservePath parameter is set to False, the Path property in the File object will have no value and the associated file will be decompressed into the base pathname provided during extraction. When a DartStream is added to the collection, any value for PreservePath will be ignored.

The following table shows some examples of wildcards:

Wildcard | Meaning
* | Compress all files in the directory and the subdirectories.
*.* | Compress all files in the directory that contain a "." in the filename.
*.txt | Compress all files in the directory with filenames that end with ".txt".
Test* | Compress all files or directories in the directory with filenames that begin with "Test"
*Test* | Compress all files or directories in the directory that contain "Test" in the filename.

Wildcards will include subdirectories when the IncludeSubs parameter is True.

You may use a mixture of filenames and wildcards for Source. Multiple files should be separated by commas. Filenames and wildcards may contain full paths, such as /Test/test.txt or /Test/*.txt. If a file in the file list specified by Source does not exist then an error is generated.

Error Codes

The Add method may generate the following error codes (refer to the ZipErrorConstants topic for a complete list of error codes):

  • zipFileNotFound

  • zipPasswordRequired

  • zipEncryptionRequired


Clear Method

Remove all the objects from the collection.

Syntax

Object.Clear

Part | Description
Object | Evaluates to a FileStore object.

Remarks

This method takes linear (O(n)) time, where n is the number of items stored.


Item Method

Returns an File object based on a numerical index

Syntax

Value = Object.Item Index

Part | Description
Object | Evaluates to a FileStore object.
Index | String or Long. Specifies an index into the collection.
Value | File object.

Remarks

None

Error Codes

The Item method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

  • ptInvalidParam1


Load Method

Example

Loads the directory structure of a zip file or memory buffer into the FileStore property.

Syntax

Object.Load (Source)

Part | Description
Object | Evaluates to a FileStore object.
Source | Variant. Specifies the name and location of the zip file to be loaded or compressed DartStream object.

Remarks

In order to manipulate an already created zip file or compressed memory buffer, the file or buffer must be loaded into the FileStore property. Once there, the data can be manipulated and then extracted to media.

Any password protection will not affect the Load method, as the zip directory structure is not encrypted.

Load can be used multiple times for the same FileStore only with nonspanned archives. The spanning mechanism will only operate with one spanned archive at a time. When merging spanned archives, they should each be Loaded and Zipped to separate nonspanned files first, then loaded into a clear FileStore. This merged FileStore can then be zipped to a spanned file or a normal archive. Additionally, a zip file loaded from a spanned archive cannot be spanned.

Error Codes

The Load method may generate the following error codes (refer to the ZipErrorConstants topic for a complete list of error codes):

  • zipBusy

  • zipImproperZipFile

  • zipFileNotFound

  • zipReadError

Warning Messages

The possible warning messages that will be populated in the WarningText property. A warning will trigger a zipWarning error when the method completes:

  • Security Unsupported

  • Incorrect File Count

  • Improper Header


Remove Method

Example

Removes a File object from the collection

Syntax

Object.Remove (Index as Long)

Part | Description
Object | Evaluates to a FileStore object.
Index | Long. Specifies the File object by position in the index.

Remarks

This method will remove a File object, which is the representation of a file or a memory buffer, from the FileStore collection. Typical usage is to remove a file or memory buffer that was previously added. This has no effect on the Unzip operation.


Unzip Method

Example

Extract the files in a zip file to the specified location or a collection of memory buffers.

Syntax

Object.Unzip (Destination, [PreservePath] [, Overwrite] [, Password])

Part | Description
Object | Evaluates to a FileStore object.
Destination | Variant. Specifies the directory location or the DartStreams collection for the decompression of zipped FileStore items.
PreservePath | Optional Boolean. Whether to preserve the internal directory structure using the value in Path.
Overwrite | Optional Boolean. Whether to overwrite existing files with the same name.
Password | Optional String. Sets the password for encrypted files.

Remarks

This method will not automatically perform an Unzip operation on a compressed zip file or memory buffer. The Load method must be used to first load the zip file or memory buffer into the FileStore property. If these files require a password, the Password parameter must be set; otherwise, the zipPasswordRequired error will be thrown. If File objects do not share a similar password, the Extract method must be used to extract the items individually.

The default value for PreservePath is True. The default value for Overwrite false.

During this operation, the Progress event will be raised in the frequency specified by the ProgressSize property of the Zip Control.

Error Codes

The Unzip method may generate the following error codes (refer to the ZipErrorConstants topic for a complete list of error codes):

  • zipBusy

  • zipPasswordRequired

  • zipReadError

  • zipFileOpen

  • zipWriteError

Warning Messages

The possible warning messages that will be populated in the WarningText property. A warning will trigger a zipWarning error when the method completes:

  • Incorrect CRC

  • Incorrect File Size


Zip Method

Example

Compress the File objects in the FileStore collection into a compressed zip file.

Syntax

Object.Zip (Destination, [, Span])

Part | Description
Object | Evaluates to a FileStore object.
Destination | Variant. Specifies the name and location of the zip file to be created or a DartStream.
Span | Optional SpanSettings. Specifies the settings for the spanned disks.

Remarks

This method will create a compressed zip file or memory buffer.

The following applies to file compression only:

The SpanSettings object identifies the characteristics of the spanned file. If the target media is not removable, make sure that the RemovableDisk property in the SpanSettings object is set to False. This will enable the creation of a multi-volume compressed file in a single location. The spanned filenames use the following extension: .zip, .001, .002, etc. with the first part always beginning with .zip when writing to a non-removable disk. If writing to a removable disk, the Disk event will fire when a new disk is required and every file extension will end with .zip, with unique volume information written to the disks volume label. To create a spanned file, a SpanSettings object must first be instantiated and configured.

During this operation, the Progress event will be raised in the frequency specified by the ProgressSize property of the Zip Control.

Spanned filenames use the following extensions: .001, .002, ..., .zip with the last part always beginning with .zip. When unzipping, the name of the .zip file should be passed in. Because of the naming convention, spanning to more than 999 pieces on a hard drive is not allowed. Additionally, the Disk Size should be greater than the central directory size, so when a large number of files is spanned the Disk Size should be at least 60 bytes times the number of spanned files.

Error Codes

The Zip method may generate the following error codes (refer to the ZipErrorConstants topic for a complete list of error codes):

  • zipBusy

  • zipPasswordRequired

  • zipWriteError

  • zipInvalidMedia

  • zipEncryptionRequired

Warning Messages

The possible warning messages that will be populated in the WarningText property. A warning will trigger a zipWarning error when the method completes:

  • Could not open File for reading


FormatConstants

Value | Constant | Description
0 | zipMicrosoft | The headers are in Microsoft format.
1 | zipUnix | The headers are in UNIX format.


SpanSettings Object

Properties Example

The settings for a compressed file that will be spanned to multiple disks/volumes.

A spanned zip file will be created with the first file designated by the .zip extension and every subsequent file will use the .00x extension(.001, .002, etc.) when compressing to a single directory or a .zip extension for every part when zipping to removable media. When writing to removable media, the part information is written to the drive volume label.


DiskSize Property

Example

Sets the size of each volume to be created during a disk spanning operation.

Syntax

Object.DiskSize

Part | Description
Object | Evaluates to a SpanSettings object.

Data Type

Long

Remarks

The default value is 0. When the value is 0, the spanning operation will not be executed, regardless of the value set in RemovableDisk. This is done to assure compatibility in non-Visual Basic environments.

To fill all the available space on the target removable media, use the value of 1 for DiskSize and True for the RemoveDisk property. To use all the available space on the target media, set RemovableDisk to True and the DiskSize property to 1.. If the RemovableDisk property is False, and the value of DiskSize is 1, zipSizeError will the thrown when the Zip method is called. To set a specific size for the media, a value greater than 1024 must be used. Any value greater than 1 and less than 1024 will generate a zipSizeError. If the FirstDiskSize property is greater than 1024, the value for this property will be ignored when creating the first volume.

The last disk will contain the Central Directory for the spanned disks. If the required size of the Central Directory is larger than the value specified, the DiskSize value will be automatically increased to encompass the needs of the Central Directory.


FirstDiskSize Property

Example

Sets the size of the first volume or disk to be created.

Syntax

Object.FirstDiskSize

Part | Description
Object | Evaluates to a SpanSettings object.

Data Type

Long

Remarks

The default value is 0. If this value is greater than 0, the size specified will over-ride the value for the DiskSize property when writing to the first disk/volume. Use this property if the first volume should not have the same size as every other volume (except the last volume). This is often necessary if you require other information to be stored on a primary disk.


MinimumSize Property

Example

Sets the smallest possible size for the target media.

Syntax

Object.MinimumSize

Part | Description
Object | Evaluates to a SpanSettings object.

Data Type

Long

Remarks

If the RemovableDisk property is True, the Disk event will be raised when the minimum value specified in this property is reached.


RemovableDisk Property

Example

Sets if the target media is removable.

Syntax

Object.RemovableDisk

Part | Description
Object | Evaluates to a SpanSettings object.

Data Type

Boolean

Remarks

The default value of this property is True. If the value of this property is True, the Disk event will be triggered when the individual volume size reaches the number specified in DiskSize. If this value is False and there is no more space available on the target media, a zipOutofSpace error will result.

Caution: If RemoveableDisk is set to true, the disk's volume label will be overwritten if it is removable. Otherwise, a zipNotRemovable error will be generated.


ErrorConstants

Value | Constant | Description
0 | ptOk | No error

Design-Time Errors

Value | Constant | Description
12001 | ptInvalidParam1 | Parameter #1 is invalid.
12002 | ptInvalidParam2 | Parameter #2 is invalid.
12003 | ptInvalidParam3 | Parameter #3 is invalid.
12004 | ptInvalidParam4 | Parameter #4 is invalid.
12009 | ptInvalidProperty | Invalid property assignment.

Run-Time Errors

Value | Constant | Description
10042 | ptOptionNotSupported | The specified socket option is not supported by the system.
10048 | ptAddressInUse | Address already in use. Only one usage of each socket address (protocol/IP address/port) is normally permitted. This error occurs if an application attempts to bind() a socket to an IP address/port that has already been used for an existing socket, or a socket that wasn't closed properly, or one that is still in the process of closing. For server applications that need to bind() multiple sockets to the same port number, the ReuseAddress property can be used
10049 | ptAddressNotAvailable | Cannot assign requested address. The requested address is not valid in its context. Normally results from an attempt to bind() to an address that is not valid for the local machine. This may also result from connect(), sendto(), WSAConnect(), WSAJoinLeaf(), or WSASendTo() when the remote address or port is not valid for a remote machine (for example, address or port 0).
10050 | ptNetworkDown | Network is down. A socket operation encountered a dead network. This could indicate a serious failure of the network system (for example,. the protocol stack that the Winsock DLL runs over), the network interface, or the local network itself.
10051 | ptNetworkUnreachable | Network is unreachable. A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host.
10052 | ptNetworkReset | Network dropped connection on reset. The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress.
10053 | ptConnectionAborted | Software caused connection abort. An established connection was aborted by the software in your host machine, possibly due to a data transmission timeout or protocol error.
10054 | ptConnectionReset | Connection reset by peer. An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, or the remote host used a "hard close" (see Abort method) on the remote socket. This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with ptNetworkReset. Subsequent operations fail with ptConnectionReset.
10055 | ptNoBufferSpace | No buffer space available. An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.
10057 | ptNotConnected | Socket is not connected. A request to send or receive data was disallowed because the socket is not connected or allocated. Any other type of operation might also return this error.
10060 | ptTimeout | Timed out. A connection attempt failed because the connected party did not properly respond after a period of time, or an established connection failed because connected host has failed to respond. Alternatively, a blocked method failed to return within the period specified by the Timeout property.
10061 | ptConnectionRefused | Connection refused. No connection could be made because the target machine actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host (for example,. one with no server application running). May also be generated by a Daemon that refuses a connection because its resources have been exhausted.
10093 | ptNotInitialized | Network interface could not be initialized.
11001 | ptHostNotFound | Host not found. No such host is known. The name is not an official hostname or alias, or it cannot be found in the database(s) being queried. This error may also be returned for protocol and service queries, and means the specified name could not be found in the relevant database.
11002 | ptTryAgain | Non-authoritative host not found. This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server. A retry at some time later may be successful.
11003 | ptNoRecovery | This is a non-recoverable error. This indicates some sort of non-recoverable error occurred during a database lookup. This may be because the database files (for example, BSD-compatible HOSTS, SERVICES or PROTOCOLS files) could not be found, or a DNS (Domain Name Server) request was returned by the server with a severe error.
11004 | ptNoData | Valid name, no data record of requested type. The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. The usual example for this is a hostname -> address translation attempt which uses the DNS, and an MX record is returned but no A record - indicating the host itself exists but is not directly reachable.
11100 | ptError | Unexpected general error.
11101 | ptProtocol | Unexpected protocol error.
11102 | ptFile | Error accessing local file storage.
11103 | ptAbort | The Abort method was called.
12005 | ptHttpInvalidUrl | The Url is unspecified or invalid.
12011 | ptBlocked | User thread is blocking in another method.
12012 | ptAuthentication | Authentication with the server failed.
12013 | ptCompile | MIB file could not be compiled.
12014 | ptConnected | A connection already exists.
12015 | ptFormatError | The server was unable to interpret the query.
12016 | ptServerError | There was a failure on the server.
12017 | ptNotFound | The name referred to in the query does not exist.
12018 | ptNotImplemented | The server does not support the request type of query.
12019 | ptOperationRefused | The server refused to perform the specified operation.
12020 | ptNoCertificate | There was an error in creating credentials.
12021 | ptInvalidMailAddress | The Email address specified was not valid.
12022 | ptNoSecurity | Secure communications is not available on this machine.
12101 | ptHeader | Occurs when a proper termination (usually a CRLFCRLF) is not found in the header.


Clear Method Example (DartStream Object)

Private Sub Command1_Click()

On Error GoTo OnError ' use intrinsic error handling

Stream1.Clear

Exit Sub

OnError: ' Any error jumps here

Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description

End Sub


DeleteOnDestroy Property Example (DartStream Object)

Private Sub Command1_Click()

On Error GoTo OnError ' use intrinsic error handling

'Destroys the file and DartStream Object.

Stream1.DeleteOnDestroy = True

Set Stream1 = Nothing

Exit Sub

OnError: ' Any error jumps here

Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description

End Sub


DartStream Object Example

Dim Stream As DartStream

Private Sub DumpToFile(FileName As String)

On Error GoTo OnError ' use intrinsic error handling

'Create or Replace any file of the same name.

Stream.FileMode = createAlways

'Dump all contents of the Stream object to a file.

Stream.FileName = FileName

Exit Sub

OnError: ' Any error jumps here

Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description

End Sub


FileName Property Example (DartStream Objectl)

FileName Property Example (DartStream Object)

Private Sub Command1_Click()

On Error GoTo OnError ' use intrinsic error handling

MsgBox "The specified name was " + Stream1.FileName

Exit Sub

OnError: ' Any error jumps here

Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description

End Sub


Position Property Example (DartStream Object)

Private Sub Command1_Click()

On Error GoTo OnError ' use intrinsic error handling

MsgBox "Current position is " & Stream1.Position

Exit Sub

OnError: ' Any error jumps here

Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description

End Sub


Read Method Example (DartStream Object)

Private Sub ReadAll(S As String)

On Error GoTo OnError ' use intrinsic error handling

'Move the position to the beginning

Stream1.Position = 0

Stream1.Read S

Exit Sub

OnError: ' Any error jumps here

Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description

End Sub


ReadBytes Method Example (DartStream Object)

Private Function ReadAll(Stream1 As DartStream) As Byte

'Move the position to the beginning

Stream1.Position = 0

ReadAll = Stream1.ReadBytes

End Function


ReadString Method Example (DartStream Object)

Private Function ReadAll(Stream1 As DartStream) As String

'Move the position to the beginning

Stream1.Position = 0

ReadAll = Stream1.ReadString

End Function


Size Property Example (DartStream Object)

Private Sub Command1_Click()

On Error GoTo OnError ' use intrinsic error handling

MsgBox "Current Size of the Stream is " & Stream1.Size

Exit Sub

OnError: ' Any error jumps here

Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description

End Sub


Write Method Example (DartStream Object)

Private Sub WriteData(S As String)

On Error GoTo OnError ' use intrinsic error handling

Stream1.Write S

Exit Sub

OnError: ' Any error jumps here

Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description

End Sub


Add Method Example (DartStreams Object)

Private Sub Command1_Click()

On Error GoTo OnError ' use intrinsic error handling

Dim Stream As New DartStream

Dim Streams As New DartStreams

Streams.Add Stream

Exit Sub

OnError: ' Any error jumps here

Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description

End Sub


Item Method Example (DartStreams Object)

Private Sub Command1_Click()

On Error GoTo OnError ' use intrinsic error handling

Dim Stream As DartStream

Set Stream = Streams.Index(2) ' explicit use of Item method

'or

Set Stream = Streams(2) ' implicit use of Item method

Exit Sub

OnError: ' Any error jumps here

Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description

End Sub


Attributes Property Example (File Object)

Private Sub MarkAsHidden()

' This sub can be used to mark a set of files in the FileStore as hidden

Dim file As file

For Each file In Zip1.FileStore

file.Attributes.HiddenFile = True

Next

End Sub


Comments Property Example (File Object)

Private Sub AddToListView(FileToAdd As File)

' This sub adds file information to a VB ListView, to provide

' a "WinZip" style display window. It assumes that uncompressed

' files are added to the FileStore using the Add or Load methods. Then

' statistics are displayed about the file using the AddToListView Sub like

' AddToListView(Zip1.FileStore.Item(1))

'Add file path and name to the display

ListView1.ListItems.Add , , FileToAdd.Path & FileToAdd.Name

'Add any comments about the file to the display

ListView1.ListItems.Add , , FileToAdd.Comments

'Add the modified date to the display

ListView1.ListItems.Add , , FileToAdd.Modified

'Add the uncompressed filesize to the display

ListView1.ListItems.Add , , FileToAdd.Size

End Sub


CompressedSize Property Example (File Object)

Private Sub LoadZipFile(Filename As String)

Dim file As file

On Error GoTo onError

' Load the zip file, this will populate the FileStore

Zip1.FileStore.Load (Filename)

' Iterate through the FileStore

For Each file In Zip1.FileStore

' CompressedSize can be used as a boolean to determine if a file

' is compressed

If file.CompressedSize <> 0 Then

Debug.Print "File: " & file.Name & " Compression %: " & file.PercentCompressed

Else

Debug.Print "File: " & file.Name & " is not compressed"

End If

Next

End Sub


CRC Property Example (File Object)

Private Sub Form_Load()

' To demonstrate a possible use for the CRC property this example

' demonstrates writing this property as part of the debug trace

' in case of an incorrect CRC check.

Zip1.QuickZip "c:\test1.txt", "c:\test1.zip"

On Error GoTo onError

Exit Sub

onError:

' check to see if the Err object contains a warning

If Err = zipWarning Then

' iterate through all warnings of all files

For i = 1 To Zip1.FileStore.Count

For j = 1 To Zip1.FileStore(i).WarningText.Count

' if the warning is b/c of an incorrect CRC check, print

' the error, the file, and the amount of the CRC property as part

' of the trace info

If InStr(Zip1.FileStore(i).WarningText(j), "Incorrect CRC") <> 0 Then

Debug.Print "CRC Check Error"

Debug.Print "File Name: " & Zip1.FileStore(i).Name

Debug.Print "CRC Value: " & Zip1.FileStore(i).CRC

End If

Next

Next

End If

End Sub


Encryption Property Example (File Object)

Private Sub CheckForEncryption()

Dim File As File

Dim Filename as String

' Check to see if a password in required

' anywhere in the FileStore

If Zip1.FileStore.PasswordRequired = True Then

' A password is required, iterate through the FileStore

' and handle each File appropriately

For Each File In Zip1.FileStore

If File.Encryption = zipStandard Then

'Extract the file using a password

File.Extract "c:\unzipped\" & File.Name, "pass"

Else

'Extract normally

File.Extract("c:\unzipped\" & File.Name)

End If

Next

End If

End Sub


File Object Example

Private Sub AddToListView(FileToAdd As File)

' This sub adds file information to a VB ListView, to provide

' a "WinZip" style display window. It assumes that uncompressed

' files are added to the FileStore using the Add method. Then

' statistics are displayed about the file using the AddToListView Sub like

' AddToListView(Zip1.FileStore.Item(1))

'Add file path and name to display

ListView1.ListItems.Add , , FileToAdd.Path & FileToAdd.Name

'Add any comments about the file to display

ListView1.ListItems.Add , , FileToAdd.Comments

'Add the modified date to the display

ListView1.ListItems.Add , , FileToAdd.Modified

'Add the filesize to display

ListView1.ListItems.Add , , FileToAdd.Size

End Sub


Extract Method Example (File Object)

Visual Basic Example

Private Sub CheckForEncryption()

Dim File As File

Dim Filename as String

' check to see if a password in required

' anywhere in the FileStore

If Zip1.FileStore.PasswordRequired = True Then

' A password is required, iterate through the FileStore

' and handle each File appropriately

For Each File In Zip1.FileStore

If File.Encryption = zipStandard Then

'Extract the file using a password

File.Extract "c:\unzipped\" & File.Name, "pass"

Else

'Extract normally

File.Extract("c:\unzipped\" & File.Name)

End If

Next

End If

End Sub

ASP (VB Script) Example

if Request.Querystring("file") = "" then

On Error Resume Next

' Create an instance of the zip component

Dim Zip1

Set Zip1 = Server.CreateObject("Dart.Zip.1")

Zip1.BackgroundOperation = zipNone

' For use in IIS, be sure DoEvents is false

Zip1.DoEvents = False

' Load the zip file, this populates the FileStore

Zip1.Load("c:\testfile.zip")

'Save session of Zip object

Session("Zip") = Zip

'Display as hyperlinks in table, these can be used to extract

'individual files.

Response.Write("<table><tr><td colspan = 2>")

Response.Write("Click 'Download' to download a file contained within testfile.zip")

Response.Write("</td></tr>")

For i = 1 to Zip1.Filestore.Count

Response.Write("<tr>")

Response.Write("<td>")

Response.Write(Zip1.Filestore.Item(i).Name)

Response.Write("</td>")

Response.Write("<td>")

' Create link pointing to current page with a querystring.

' When this is clicked, a GET will be performed on the current

' page. The querystring variable will be retrieved as well as

' the Zip object from the session. The querystring file

' variable can then be used as an indexer into the FileStore.

' Then the response to the browser can be made the file.

Response.Write("<a href='thispage.asp?file=" & i & ">Download</a>")

Response.Write("</td>")

Response.Write<"</tr>")

Next

Response.Write("</table>")

else

if Request.QueryString("file") <> "" then

' One of the links in the table above was clicked

Dim Zip1

Dim stream

Dim index

' Get the Zip object from the Session.

Zip1 = Session("Zip")

' Create a DartStream to be unzipped into.

stream = Server.CreateObject("Dart.DartStream")

' Get the index from the querystring.

index = Request.QueryString("file")

' Extract the file requested into the stream

Zip1.FileStore.Item(index).Extract(stream)

'Now send the unzipped file as the response to the browser

' Change content type to octet/stream

Response.ContentType = "application/octet-stream"

' Change disposition so that save as box has correct name

Response.AddHeader "Content-Disposition", Zip1.Filestore.Item(index).Name

' Send binary bytes

Response.BinaryWrite stream.ReadBytes()

end if

end if


Modified Property Example (File Object)

Private Sub AddToListView(FileToAdd As File)

' This sub adds file information to a VB ListView, to provide

' a "WinZip" style display window. It assumes that uncompressed

' files are added to the FileStore using the Add or Load methods. Then

' statistics are displayed about the file using the AddToListView Sub like

' AddToListView(Zip1.FileStore.Item(1))

'Add file path and name to the display

ListView1.ListItems.Add , , FileToAdd.Path & FileToAdd.Name

'Add any comments about the file to display

ListView1.ListItems.Add , , FileToAdd.Comments

'Add the modified date to the display

ListView1.ListItems.Add , , FileToAdd.Modified

'Add the uncompressed filesize to the display

ListView1.ListItems.Add , , FileToAdd.Size

End Sub


Name Property Example (File Object)

Private Sub LoadZipFile(Filename As String)

'This sub demonstrates using the Load method to load a zip file and

'populate Zip1.Filestore. Compression statistics can then be

'displayed to the user

Dim file As file

On Error GoTo onError

' Load the zip file, this will populate the FileStore

Zip1.FileStore.Load (Filename)

lstLog.AddItem ("Zip File " & Filename & " successfully loaded.")

' Display the size of the uncompressed bytes

lstLog.AddItem ("There are " & Zip1.FileStore.TotalBytes & " uncompressed bytes in the collection.")

' Check for a volume label and display

If Zip1.FileStore.VolumeLabel <> "" Then

lstLog.AddItem ("The Volume Label for the collection is : " & Zip1.FileStore.VolumeLabel)

End If

' Iterate through filestore and display names.

lstLog.AddItem ("Files contained within " & Filename & ":")

For Each file In Zip1.FileStore

AddFileInfoToDisplay (file)

Next

Exit Sub

onError:

MsgBox ("Error: " & Err.Description)

End Sub

Private Sub AddFileInfoToDisplay(file As file)

'Display name and path of file in the ListView

ListViewDisplay.ListItems.Add , , file.Path & file.Name

'Display uncompressed size of the file in the ListView

ListViewDisplay.ListItems.Add , , file.Size

'Display compressed of the file in the ListView

ListViewDisplay.ListItems.Add , , file.CompressedSize

'Display compression percentage in the ListView

ListViewDisplay.ListItems.Add , , file.PercentCompressed

End Sub


Path Property Example (File Object)

Private Sub LoadZipFile(Filename As String)

'This sub demonstrates using the Load method to load a zip file and

'populate Zip1.Filestore. Compression statistics can then be

'displayed to the user

Dim file As file

On Error GoTo onError

' Load the zip file, this will populate the FileStore

Zip1.FileStore.Load (Filename)

lstLog.AddItem ("Zip File " & Filename & " successfully loaded.")

' Display the size of the uncompressed bytes

lstLog.AddItem ("There are " & Zip1.FileStore.TotalBytes & " uncompressed bytes in the collection.")

' Check for a volume label and display

If Zip1.FileStore.VolumeLabel <> "" Then

lstLog.AddItem ("The Volume Label for the collection is : " & Zip1.FileStore.VolumeLabel)

End If

' Iterate through filestore and display names.

lstLog.AddItem ("Files contained within " & Filename & ":")

For Each file In Zip1.FileStore

AddFileInfoToDisplay (file)

Next

Exit Sub

onError:

MsgBox ("Error: " & Err.Description)

End Sub

Private Sub AddFileInfoToDisplay(file As file)

'Display name and path of file in the ListView

ListViewDisplay.ListItems.Add , , file.Path & file.Name

'Display uncompressed size of the file in the ListView

ListViewDisplay.ListItems.Add , , file.Size

'Display compressed of the file in the ListView

ListViewDisplay.ListItems.Add , , file.CompressedSize

'Display compression percentage in the ListView

ListViewDisplay.ListItems.Add , , file.PercentCompressed

End Sub


PercentCompressed Property (File Object)

rivate Sub LoadZipFile(Filename As String)

Dim file As file

On Error GoTo onError

' Load the zip file, this will populate the FileStore

Zip1.FileStore.Load (Filename)

' Iterate through the FileStore

For Each file In Zip1.FileStore

' CompressedSize can be used as a boolean to determine if a file

' is compressed

If file.CompressedSize <> 0 Then

Debug.Print "File: " & file.Name & " Compression %: " & file.PercentCompressed

Else

Debug.Print "File: " & file.Name & " is not compressed"

End If

Next

End Sub


Size Property Example (File Object)

Private Sub LoadZipFile(Filename As String)

'This sub demonstrates using the Load method to load a zip file and

'populate Zip1.Filestore. Compression statistics can then be

'displayed to the user

Dim file As file

On Error GoTo onError

' Load the zip file, this will populate the FileStore

Zip1.FileStore.Load (Filename)

lstLog.AddItem ("Zip File " & Filename & " successfully loaded.")

' Display the size of the uncompressed bytes

lstLog.AddItem ("There are " & Zip1.FileStore.TotalBytes & " uncompressed bytes in the collection.")

' Check for a volume label and display

If Zip1.FileStore.VolumeLabel <> "" Then

lstLog.AddItem ("The Volume Label for the collection is : " & Zip1.FileStore.VolumeLabel)

End If

' Iterate through filestore and display names.

lstLog.AddItem ("Files contained within " & Filename & ":")

For Each file In Zip1.FileStore

AddFileInfoToDisplay (file)

Next

Exit Sub

onError:

MsgBox ("Error: " & Err.Description)

End Sub

Private Sub AddFileInfoToDisplay(file As file)

'Display name and path of file in the ListView

ListViewDisplay.ListItems.Add , , file.Path & file.Name

'Display uncompressed size of the file in the ListView

ListViewDisplay.ListItems.Add , , file.Size

'Display compressed of the file in the ListView

ListViewDisplay.ListItems.Add , , file.CompressedSize

'Display compression percentage in the ListView

ListViewDisplay.ListItems.Add , , file.PercentCompressed

End Sub


WarningText Property Example (File Object)

Private Sub Command1_Click()

On Error GoTo OnError

Zip1.QuickZip "c:\test1.txt", "c:\test1.zip"

Exit Sub

OnError:

' Check if the error is a warning or an error

If Err = zipWarning Then

' It is a warning, display each

lstDisplay.AddItem ("The Zip operation has completed with the following warnings")

For i = 1 To Zip1.FileStore.Count

lstDisplay.AddItem ("File: " & Zip1.FileStore(i).Name)

For j = 1 To Zip1.FileStore(i).WarningText.Count

lstDisplay.AddItem ("Warning:" & Zip1.FileStore(i).WarningText(j))

Next

Next

Else

' It is an error, display notification

lstDisplay.AddItem ("A critical error has occurred")

End If

End Sub


ArchiveFile Property Example (FileAttributes Object)

Private Sub MarkAsArchive()

' This sub can be used to mark a set of files in the FileStore as Archive

Dim file As file

For Each file In Zip1.FileStore

file.Attributes.ArchiveFile = True

Next

End Sub


FileAttributes Object Example

Private Sub MarkAsHidden()

' This sub can be used to mark a set of files in the FileStore as hidden

Dim file As file

For Each file In Zip1.FileStore

file.Attributes.HiddenFile = True

Next

End Sub


HiddenFile Property Example (FileAttributes Object)

Private Sub MarkAsHidden()

' This sub can be used to mark a set of files in the FileStore as hidden

Dim file As file

For Each file In Zip1.FileStore

file.Attributes.HiddenFile = True

Next

End Sub


NTCompressedFile Property Example (FileAttributes Object)

Private Sub MarkAsNTCompressed()

' This sub can be used to mark a set of files in the FileStore as NT Compressed

Dim file As file

For Each file In Zip1.FileStore

file.Attributes.NTCompressedFile = True

Next

End Sub


NTEncryptedFile Property Example (FileAttributes Object)

Private Sub MarkAsNTEncrypted()

' This sub can be used to mark a set of files in the FileStore as NT Encrypted

Dim file As file

For Each file In Zip1.FileStore

file.Attributes.NTEncryptedFile = True

Next

End Sub


ReadOnlyFile Property Example (FileAttributes Object)

Private Sub Command1_Click()

On Error GoTo onError

' Add files to be zipped to the FileStore, after which each will be

' represented by a File Object.

' The following files will all keep their directory structure because

' the PreservePath parameter is True

Zip1.FileStore.Add "c:\images\image1.bmp", True

Zip1.FileStore.Add "c:\images\image2.bmp", True

Zip1.FileStore.Add "c:\docs\test1.doc", True

Zip1.FileStore.Add "c:\docs\test2.doc", True

' The following file will be encrypted using standard Zip

' encryption.

Zip1.FileStore.Add "c:\personal\test1.doc", True, "MyPassword", zipStandard

Zip1.FileStore.Add ("c:\text2.txt")

Zip1.FileStore.Add ("c:\text3.txt")

' In this example we want the files, once unzipped, to be read only

' so iterate through FileStore and set the Attributes to be sure that

' each file is read only

For i = 1 To Zip1.FileStore.Count

Zip1.FileStore(i).Attributes.ReadOnlyFile = True

Next

' Zip the files

Zip1.FileStore.Zip ("c:\zipped\zippedfiles.zip")

MsgBox ("Done!")

Exit Sub

onError:

MsgBox ("Error " & Err.Description)

End Sub


SystemFile Property Example (FileAttributes Object)

Private Sub MarkAsSystem()

' This sub can be used to mark a set of files in the FileStore as a system file

Dim file As file

For Each file In Zip1.FileStore

file.Attributes.System = True

Next

End Sub


Add Method Example (FileStore Object)

Private Sub Command1_Click()

On Error GoTo onError

' Add files to be zipped to the FileStore, after which each will be

' represented by a File Object.

' The following files will all keep their directory structure because

' the PreservePath parameter is True

Zip1.FileStore.Add "c:\images\image1.bmp", True

Zip1.FileStore.Add "c:\images\image2.bmp", True

Zip1.FileStore.Add "c:\docs\test1.doc", True

Zip1.FileStore.Add "c:\docs\test2.doc", True

' The following file will be encrypted using standard Zip

' encryption.

Zip1.FileStore.Add "c:\personal\test1.doc", True, "MyPassword", zipStandard

Zip1.FileStore.Add ("c:\textfiles\text2.txt")

Zip1.FileStore.Add ("c:\textfiles\text3.txt")

' In this example we want the files, once unzipped, to be read only

' so iterate through FileStore and set the Attributes to be sure that

' each file is read only

For i = 1 To Zip1.FileStore.Count

Zip1.FileStore(i).Attributes.ReadOnlyFile = True

Next

' Zip the files

Zip1.FileStore.Zip ("c:\zipped\zippedfiles.zip")

MsgBox ("Done!")

Exit Sub

onError:

MsgBox ("Error " & Err.Description)

End Sub


FileStore Object Example

Visual Basic Example

Private Sub Command1_Click()

On Error GoTo onError

' Add files to be zipped to the FileStore, after which each will be

' represented by a File Object.

' The following files will all keep their directory structure because

' the PreservePath parameter is True

Zip1.FileStore.Add "c:\images\image1.bmp", True

Zip1.FileStore.Add "c:\images\image2.bmp", True

Zip1.FileStore.Add "c:\docs\test1.doc", True

Zip1.FileStore.Add "c:\docs\test2.doc", True

' The following file will be encrypted using standard Zip

' encryption.

Zip1.FileStore.Add "c:\personal\test1.doc", True, "MyPassword", zipStandard

Zip1.FileStore.Add ("c:\text2.txt")

Zip1.FileStore.Add ("c:\text3.txt")

' In this example we want the files, once unzipped, to be read only

' so iterate through FileStore and set the Attributes to be sure that

' each file is read only

For i = 1 To Zip1.FileStore.Count

Zip1.FileStore(i).Attributes.ReadOnlyFile = True

Next

' Zip the files

Zip1.FileStore.Zip ("c:\zipped\zippedfiles.zip")

MsgBox ("Done!")

Exit Sub

onError:

MsgBox ("Error " & Err.Description)

End Sub

ASP (VB Script) Example

if Request.Querystring("file") = "" then

On Error Resume Next

' Create an instance of the zip component

Dim Zip1

Set Zip1 = Server.CreateObject("Dart.Zip.1")

Zip1.BackgroundOperation = zipNone

' For use in IIS, be sure DoEvents is false

Zip1.DoEvents = False

' Load the zip file, this populates the FileStore

Zip1.Load("c:\testfile.zip")

'Save session of Zip object

Session("Zip") = Zip1

'Display as hyperlinks in table, these can be used to extract

'individual files.

Response.Write("<table><tr><td colspan = 2>")

Response.Write("Click 'Download' to download a file contained within testfile.zip")

Response.Write("</td></tr>")

For i = 1 to Zip1.Filestore.Count

Response.Write("<tr>")

Response.Write("<td>")

Response.Write(Zip1.Filestore.Item(i).Name)

Response.Write("</td>")

Response.Write("<td>")

' Create link pointing to current page with a querystring.

' When this is clicked, a GET will be performed on the current

' page. The querystring variable will be retrieved as well as

' the Zip object from the session. The querystring file

' variable can then be used as an indexer into the FileStore.

' Then the response to the browser can be made the file.

Response.Write("<a href='thispage.asp?file=" & i & ">Download</a>")

Response.Write("</td>")

Response.Write<"</tr>")

Next

Response.Write("</table>")

else

if Request.QueryString("file") <> "" then

' One of the links in the table above was clicked

Dim Zip1

Dim stream

Dim index

' Get the Zip object from the Session.

Zip1 = Session("Zip")

' Create a DartStream to be unzipped into.

stream = Server.CreateObject("Dart.DartStream")

' Get the index from the querystring.

index = Request.QueryString("file")

' Extract the file requested into the stream

Zip1.FileStore.Item(index).Extract(stream)

'Now send the unzipped file as the response to the browser

' Change content type to octet/stream

Response.ContentType = "application/octet-stream"

' Change disposition so that save as box has correct name

Response.AddHeader "Content-Disposition", Zip1.Filestore.Item(index).Name

' Send binary bytes

Response.BinaryWrite stream.ReadBytes()

end if

end if


Format Property Example (FileStore Object)

Private Sub MultiPlatformZip(FileNames As DartStrings)

'This sub demonstrates zipping a series of files

'that will be needed on both Microsoft and Unix platforms, it assumes

'the need to distibute a set of zipped files to both MS and UNIX

'platforms

'Add files to filestore

For i = 1 To FileNames.Count

Zip1.FileStore.Add (FileNames.Item(i))

Next

'Set Header to Microsoft format, this will ensure that the files will

'be able to be zipped, unzipped, and stored in a manner that is

'compatible with MS

Zip1.FileStore.Format = zipMicrosoft

'Zip and save to appropriate dir on MS machine

Zip1.FileStore.Zip ("\\MicrosoftMachine\c\mszipped\files.zip")

'Set Header to UNIX format, this will ensure that the files will

'be able to be unzipped, unzipped, and stored in a manner that is

'compatible with UNIX

Zip1.FileStore.Format = zipUnix

'Zip and save to appropriate dir on UNIX machine

Zip1.FileStore.Zip ("\\UNIXMachine\c\unixzipped\files.zip")

End Sub


Load Method Example (FileStore Object)

Visual Basic Example

Private Sub LoadZipFile(Filename As String)

'This sub demonstrates using the Load method to load a zip file and

'populate Zip1.Filestore. Compression statistics can then be

'displayed to the user

Dim file As file

On Error GoTo onError

' Load the zip file, this will populate the FileStore

Zip1.FileStore.Load (Filename)

lstLog.AddItem ("Zip File " & Filename & " successfully loaded.")

' Display the size of the uncompressed bytes

lstLog.AddItem ("There are " & Zip1.FileStore.TotalBytes & " uncompressed bytes in the collection.")

' Check for a volume label and display

If Zip1.FileStore.VolumeLabel <> "" Then

lstLog.AddItem ("The Volume Label for the collection is : " & Zip1.FileStore.VolumeLabel)

End If

' Iterate through filestore and display names.

lstLog.AddItem ("Files contained within " & Filename & ":")

For Each file In Zip1.FileStore

AddFileInfoToDisplay (file)

Next

Exit Sub

onError:

MsgBox ("Error: " & Err.Description)

End Sub

Private Sub AddFileInfoToDisplay(file As file)

'Display name and path of file in the ListView

ListViewDisplay.ListItems.Add , , file.Path & file.Name

'Display uncompressed size of the file in the ListView

ListViewDisplay.ListItems.Add , , file.Size

'Display compressed of the file in the ListView

ListViewDisplay.ListItems.Add , , file.CompressedSize

'Display compression percentage in the ListView

ListViewDisplay.ListItems.Add , , file.PercentCompressed

End Sub

ASP (VB Script) Example

if Request.Querystring("file") = "" then

On Error Resume Next

' Create an instance of the zip component

Dim Zip1

Set Zip1 = Server.CreateObject("Dart.Zip.1")

Zip1.BackgroundOperation = zipNone

' For use in IIS, be sure DoEvents is false

Zip1.DoEvents = False

' Load the zip file, this populates the FileStore

Zip1.Load("c:\testfile.zip")

'Save session of Zip object

Session("Zip") = Zip

'Display as hyperlinks in table, these can be used to extract

'individual files.

Response.Write("<table><tr><td colspan = 2>")

Response.Write("Click 'Download' to download a file contained within testfile.zip")

Response.Write("</td></tr>")

For i = 1 to Zip1.Filestore.Count

Response.Write("<tr>")

Response.Write("<td>")

Response.Write(Zip1.Filestore.Item(i).Name)

Response.Write("</td>")

Response.Write("<td>")

' Create link pointing to current page with a querystring.

' When this is clicked, a GET will be performed on the current

' page. The querystring variable will be retrieved as well as

' the Zip object from the session. The querystring file

' variable can then be used as an indexer into the FileStore.

' Then the response to the browser can be made the file.

Response.Write("<a href='thispage.asp?file=" & i & ">Download</a>")

Response.Write("</td>")

Response.Write<"</tr>")

Next

Response.Write("</table>")

else

if Request.QueryString("file") <> "" then

' One of the links in the table above was clicked

Dim Zip1

Dim stream

Dim index

' Get the Zip object from the Session.

Zip1 = Session("Zip")

' Create a DartStream to be unzipped into.

stream = Server.CreateObject("Dart.DartStream")

' Get the index from the querystring.

index = Request.QueryString("file")

' Extract the file requested into the stream

Zip1.FileStore.Item(index).Extract(stream)

'Now send the unzipped file as the response to the browser

' Change content type to octet/stream

Response.ContentType = "application/octet-stream"

' Change disposition so that save as box has correct name

Response.AddHeader "Content-Disposition", Zip1.Filestore.Item(index).Name

' Send binary bytes

Response.BinaryWrite stream.ReadBytes()

end if

end if


PasswordRequired Property Example (FileStore Object)

Private Sub CheckForEncryption()

Dim File As File

Dim Filename as String

' Check to see if a password in required

' anywhere in the FileStore

If Zip1.FileStore.PasswordRequired = True Then

' A password is required, iterate through the FileStore

' and handle each File appropriately

For Each File In Zip1.FileStore

If File.Encryption = zipStandard Then

'Extract the file using a password

File.Extract "c:\unzipped\" & File.Name, "pass"

Else

'Extract normally

File.Extract("c:\unzipped\" & File.Name)

End If

Next

End If

End Sub


Remove Method Example (FileStore Object)

The following example demonstrates adding a directory of files, then removing all executables before zipping.

Private Sub Command1_Click()

On Error GoTo onError

' Add a directory of files.

Zip1.FileStore.Add "C:\temp\*.*"

' Iterate through the FileStore and remove all exes

Dim n As Integer

n = 1

While n < Zip1.FileStore.Count

If Right(Zip1.FileStore(n).Name, 3) = "exe" Then

Zip1.FileStore.Remove (n)

Else

n = n + 1

End If

Wend

Zip1.FileStore.Zip("C:\myzipped\zipfile.zip")

Exit Sub

onError:

Text2.Text = Err.Number & " " & Err.Description

End Sub


TotalBytes Property Example (FileStore Object)

Private Sub Form_Load()

' Set Progress event to fire every 512k

Zip1.ProgressSize = 512

' Begin a zip operation

Zip1.QuickZip "c:\test1.txt", "c:\test1.zip"

End Sub

Private Sub Zip1_Progress(Status As ZipStatusConstants, File As File, FileNumber As Long, FileBytes As Long, TotalBytes As Long)

Dim s As String

s = "Current Operation : "

' Get the current operation and display

Select Case Status

Case zipBeginZip

s = s & "Beginning Zip Compression for " & File

Case zipZipping

s = s & "Compressing Data for " & File

Case zipEndZip

s = s & "Finishing Zip Compression for " & File

Case zipBeginUnzip

s = s & "Beginning Zip Decompression for " & File

Case zipUnzipping

s = s & "Decompressing Data for " & File

Case zipEndUnzip

s = s & "Finishing Zip Decompression for " & File

Case zipTesting

s = s & "Testing Compressed File for " & File

Case zipFixing

s = s & "Attempting To Fix A Corrupt File for " & File

End Select

' Display amount of kilobytes processed for each file

s = s & vbCrLf & FileBytes & " uncompressed kilobytes of " & File.Size

lblOperation.Caption = s

' Display amount of kilobytes processed for entire collection

lblTotal.Caption = "Total Progress " & TotalBytes & " uncompressed kilobytes of " & Zip1.FileStore.TotalBytes

End Sub


Unzip Method Example (FileStore Object)

Visual Basic Example

Private Sub UnzipFile ()

'Load the file that will be unzipped – this will load the internal zip directory

'into the Files ‘property for viewing

Zip1.Load (“c:\temp\update.zip”)

'Unzip the files loaded from update.zip into “c:\files\new\”

Zip1.Unzip “c:\files\new”, True

End Sub

'Unzip the contents of the FileStore collection into a memory buffer.

Private Sub FillBuffers () as DartStreams

Dim Streams As DartStreams

'Load the file that will be unzipped – this will load the internal zip directory

'into the FileStore property for viewing

Set Streams = New DartStreams

Zip1.FileStore.Load “c:\temp\update.zip”

'Unzip the files loaded from update.zip into a memory buffer

Zip1.FileStore.Unzip Streams

Set FillBuffers = Streams

End Sub

ASP (VB Script) Example

Sub ExtractFile(filewanted)

' This sub demonstrates a web interface to retrieve files contained

' within a zip archive on the server. The filewanted parameter is a

' long representing a number into the index.

' Create Zip component

Dim Zip1

Set Zip1 = Server.CreateObject("Dart.Zip.1")

' Create DartStreams

Dim streams

Set streams = Server.CreateObject("Dart.DartStreams")

'Load Zip archive

Zip1.Filestore.Load("c:\archive\logs.zip")

'Unzip into buffer

Zip1.Filestore.Unzip streams

'Now send the unzipped file as the response to the browser

'Change content type to octet/stream

Response.ContentType = "application/octet-stream"

' Change disposition so that save as box has correct name

Response.AddHeader "Content-Disposition", Zip1.Filestore.Item(filewanted).Name

' Send binary bytes of the file wanted

Response.BinaryWrite streams.Item(filewanted).ReadBytes()

End Sub


VolumeLabel Property Example (FileStore Object)

Private Sub LoadZipFile(Filename As String)

'This sub demonstrates using the Load method to load a zip file and

'populate Zip1.Filestore. Compression statistics can then be

'displayed to the user

Dim file As file

On Error GoTo onError

' Load the zip file, this will populate the FileStore

Zip1.FileStore.Load (Filename)

lstLog.AddItem ("Zip File " & Filename & " successfully loaded.")

' Display the size of the uncompressed bytes

lstLog.AddItem ("There are " & Zip1.FileStore.TotalBytes & " uncompressed bytes in the collection.")

' Check for a volume label and display

If Zip1.FileStore.VolumeLabel <> "" Then

lstLog.AddItem ("The Volume Label for the collection is : " & Zip1.FileStore.VolumeLabel)

End If

' Iterate through filestore and display names.

lstLog.AddItem ("Files contained within " & Filename & ":")

For Each file In Zip1.FileStore

AddFileInfoToDisplay (file)

Next

Exit Sub

onError:

MsgBox ("Error: " & Err.Description)

End Sub

Private Sub AddFileInfoToDisplay(file As file)

'Display name and path of file in the ListView

ListViewDisplay.ListItems.Add , , file.Path & file.Name

'Display uncompressed size of the file in the ListView

ListViewDisplay.ListItems.Add , , file.Size

'Display compressed of the file in the ListView

ListViewDisplay.ListItems.Add , , file.CompressedSize

'Display compression percentage in the ListView

ListViewDisplay.ListItems.Add , , file.PercentCompressed

End Sub


Zip Method Example (FileStore Object)

Visual Basic Example

Private Sub ZipFile ()

Dim Span as SpanSettings

' Create a new SpanSettings object and configure it

Set Span = New SpanSettings

' Sets the first disk to be 1.3 Meg in size – this is Optional

Span.FirstDiskSize = 1300000

' Specifies that the target media is removable – the default is True

Span.RemovableDisk = True

' Set to 1 to specify to fill all available space (RemovableDisk

' property must be set to true)

Span.DiskSize = 0

' Specifies that the minimum empty space on the target media must

' be 1.2 Meg

Span.MinimumSize = 1200000

' Perform a spanning zip operation

Zip1.FileStore.Zip “c:\docs\info.zip”, Span

End Sub

'Compress the contents of the FileStore into a memory buffer.

Private Function CreateBuffer () as DartStream

Dim Stream as DartStream

'Create a new DartStream object to hold the compressed data

Set Stream = New DartStream

'Compress the data

Zip1.FileStore.Zip Stream

Set CreateBuffer = Stream

End Function

ASP (VB Script) Example

'This example demonstrates archiving a file (or set of files) on the

'server, zipping them, then returning them as the response to the browser

if Request.Form("theFile") <> "" then

'A form was submitted requesting a file on the local server.

' Create an instance of the zip component

Dim Zip1

Set Zip1 = Server.CreateObject("Dart.Zip.1")

' Create a DartStream to hold the results of the zip

Dim stream

stream = Server.CreateObject("Dart.DartStream")

Zip1.BackgroundOperation = zipNone

' For use in IIS, be sure DoEvents is false

Zip1.DoEvents = False

Zip1.Filestore.Add(Request.Form("theFile"))

Zip1.Filestore.Zip(stream)

'Now send the unzipped file as the response to the browser

' Change content type to octet/stream

Response.ContentType = "application/octet-stream"

' Change disposition so that save as box has correct name

Response.AddHeader "Content-Disposition", Zip1.Filestore.Item(index).Name

' Send binary bytes

Response.BinaryWrite stream.ReadBytes()

end if


DiskSize Property Example (SpanSettings Object)

Private Sub ZipFile ()

Dim Span as SpanSettings

' Create a new SpanSettings object and configure it

Set Span = New SpanSettings

' Sets the first disk to be 1.3 Meg in size – this is Optional

Span.FirstDiskSize = 1300000

' Specifies that the target media is removable – the default is True

Span.RemovableDisk = True

' Set to 1 to specify to fill all available space (RemovableDisk

' property must be set to true)

Span.DiskSize = 1

' Specifies that the minimum empty space on the target media must

' be 1.2 Meg

Span.MinimumSize = 1200000

' Perform a spanning zip operation

Zip1.FileStore.Zip “c:\docs\info.zip”, Span

End Sub


SpanSettings Object Example

Zip Method Example (FileStore Object)

Private Sub ZipFile ()

Dim Span as SpanSettings

' Create a new SpanSettings object and configure it

Set Span = New SpanSettings

' Sets the first disk to be 1.3 Meg in size – this is Optional

Span.FirstDiskSize = 1300000

' Specifies that the target media is removable – the default is True

Span.RemovableDisk = True

' Set to 1 to specify to fill all available space (RemovableDisk

' property must be set to true)

Span.DiskSize = 1

' Specifies that the minimum empty space on the target media must

' be 1.2 Meg

Span.MinimumSize = 1200000

' Perform a spanning zip operation

Zip1.FileStore.Zip “c:\docs\info.zip”, Span

End Sub


FirstDiskSize Property Example (SpanSettings Object)

Private Sub ZipFile ()

Dim Span as SpanSettings

' Create a new SpanSettings object and configure it

Set Span = New SpanSettings

' Sets the first disk to be 1.3 Meg in size – this is Optional

Span.FirstDiskSize = 1300000

' Specifies that the target media is removable – the default is True

Span.RemovableDisk = True

' Set to 1 to specify to fill all available space (RemovableDisk

' property must be set to true)

Span.DiskSize = 1

' Specifies that the minimum empty space on the target media must

' be 1.2 Meg

Span.MinimumSize = 1200000

' Perform a spanning zip operation

Zip1.FileStore.Zip “c:\docs\info.zip”, Span

End Sub


MinimumSize Property Example (SpanSettings Object)

Private Sub ZipFile ()

Dim Span as SpanSettings

' Create a new SpanSettings object and configure it

Set Span = New SpanSettings

' Sets the first disk to be 1.3 Meg in size – this is Optional

Span.FirstDiskSize = 1300000

' Specifies that the target media is removable – the default is True

Span.RemovableDisk = True

' Set to 1 to specify to fill all available space (RemovableDisk

' property must be set to true)

Span.DiskSize = 1

' Specifies that the minimum empty space on the target media must

' be 1.2 Meg

Span.MinimumSize = 1200000

' Perform a spanning zip operation

Zip1.FileStore.Zip “c:\docs\info.zip”, Span

End Sub


RemovableDisk Property Example (SpanSettings Object)

Private Sub ZipFile ()

Dim Span as SpanSettings

' Create a new SpanSettings object and configure it

Set Span = New SpanSettings

' Sets the first disk to be 1.3 Meg in size – this is Optional

Span.FirstDiskSize = 1300000

' Specifies that the target media is removable – the default is True

Span.RemovableDisk = True

' Set to 1 to specify to fill all available space (RemovableDisk

' property must be set to true)

Span.DiskSize = 1

' Specifies that the minimum empty space on the target media must

' be 1.2 Meg

Span.MinimumSize = 1200000

' Perform a spanning zip operation

Zip1.FileStore.Zip “c:\docs\info.zip”, Span

End Sub


Abort Method Example (Zip Control)

Private Sub cmdZipFile_Click()

' Set DoEvents to True so the app can still process

' UI events.

Zip1.DoEvents = True

Zip1.QuickZip "c:\temp\reallyhugefile.bmp", "C:\zipped\zippedfile.zip"

End Sub

Private Sub cmdAbortOperation_Click()

'If this button was clicked, it means the user has

'requested an Abort. This is possible as DoEvents was set to True

Zip1.Abort

MsgBox ("Zip Aborted!")

End Sub


BackgroundOperation Property Example (Zip Control)

Private Sub Form_Load()

' Set BackgroundOperation to zipNormal so the zip operation will be

' asynchronous.

Zip1.BackgroundOperation = zipNormal

' Set Progress event to fire every 512k

Zip1.ProgressSize = 512

' Begin a zip operation

Zip1.QuickZip "c:\test1.txt", "c:\zipped\test1.zip"

' Display a message, since BackgroundOperation is zipNormal, this will be

' immediately executed.

lblStatus.Caption = "Beginning Zip Operation on the FileStore"

End Sub

Private Sub Zip1_Progress(Status As ZipStatusConstants, File As File, FileNumber As Long, FileBytes As Long, TotalBytes As Long)

Dim s As String

s = "Current Operation : "

' Get the current operation and display

Select Case Status

Case zipBeginZip

s = s & "Beginning Zip Compression for " & File

Case zipZipping

s = s & "Compressing Data for " & File

Case zipEndZip

s = s & "Finishing Zip Compression for " & File

Case zipBeginUnzip

s = s & "Beginning Zip Decompression for " & File

Case zipUnzipping

s = s & "Decompressing Data for " & File

Case zipEndUnzip

s = s & "Finishing Zip Decompression for " & File

Case zipTesting

s = s & "Testing Compressed File for " & File

Case zipFixing

s = s & "Attempting To Fix A Corrupt File for " & File

End Select

' Display amount of kilobytes processed for each file

s = s & vbCrLf & FileBytes & " uncompressed kilobytes of " & File.Size

lblOperation.Caption = s

' Display amount of kilobytes processed for entire collection

lblTotal.Caption = "Total Progress " & TotalBytes & " uncompressed kilobytes of " & Zip1.FileStore.TotalBytes

End Sub


Disk Event Example (Zip Control)

Private Sub Command1_Click()

' Create and set SpanSettings object for a removable disk

Dim Span As SpanSettings

' Initialize object

Set Span = New SpanSettings

Span.RemovableDisk = True

Zip1.BackgroundOperation = zipNormal

Zip1.FileStore.Add ("c:\bigfile.bmp")

Zip1.FileStore.Add ("c:\bigfile2.bmp")

Zip1.FileStore.Add ("c:\bigfile3.bmp")

Zip1.FileStore.Zip "a:\zipped.zip", False, Span

End Sub

Private Sub Zip1_Disk(DiskNeeded As Integer)

'Disk Event Fired, prompt for next disk

Dim s

s = "Disk Needed" & vbCrLf

s = "Please insert Disk " & DiskNeeded & " and click OK"

MsgBox (s)

End Sub


DoEvents Property Example (Zip Control)

<%

'This ASP Example demonstrates zipping a local file which is specified

'by a form submission, zipping this file, and archiving it on the server.

'This example also demonstrates disabling events for use in IIS.

if Request.Form("LocalFileName") <> "" then

' The form was submitted with a value for LocalFileName,

' zip and archive

On Error Resume Next

' Create an instance of the zip component

Dim Zip1

Set Zip1 = Server.CreateObject("Dart.Zip.1")

' Retrieve the filename(s) to archive

Dim FileName

FileName = Request.Form("LocalFileName")

Zip1.BackgroundOperation = zipNone

' For use in IIS, be sure DoEvents is false

Zip1.DoEvents = False

' Create file name for the archive based on the date

Dim ArchivedFile

ArchivedFile = DateValue(Now())

ArchivedFile = Replace(ArchivedFile, "/", "_")

' Zip the file(s) and report.

Zip1.QuickZip FileName, "C:\archive\" & ArchivedFile & ".zip"

if err = 0 then

Response.Write(FileName & " successfully archived.")

else

Response.Write("An error occurred during the archive attempt.")

end if

end if

%>


Error Event Example (Zip Control)

Private Sub Form_Load()

' On Form_Load attempt to Zip. In this example,

' error handling will occur in the Error_Event

Zip1.QuickZip "c:\file1.txt", "c:\file1.zip"

End Sub

Private Sub Zip1_Error(Number As ZipErrorConstants, Description As String)

' Error Event triggered, could be an actual error or a warning (which

' would fire after the QuickZip operation), check to see which

' is the case

If Number = zipWarning Then 'a warning has occurred, display to user

Dim File As File

Dim s As String

s = s & "The operation has completed with the following warnings:" & vbCrLf

For Each File In Zip1.FileStore

If File.WarningText.Count > 0 Then

s = s & "File " & File.Name & vbCrLf

For i = 1 To File.WarningText.Count

s = s & File.WarningText.Item(i) & vbCrLf

Next

End If

Next

Else

' An error has occurred, handle appropriately (in this case display

' a message).

MsgBox ("Zip Error " & Description & vbCrLf & " Operation Aborted")

End If

End Sub


Zip Control Example

Visual Basic Example

Private Sub Command1_Click()

On Error GoTo onError

' Add files to be zipped to the FileStore, after which each will be

' represented by a File Object.

' The following files will all keep their directory structure because

' the PreservePath parameter is True

Zip1.FileStore.Add "c:\images\image1.bmp", True

Zip1.FileStore.Add "c:\images\image2.bmp", True

Zip1.FileStore.Add "c:\docs\test1.doc", True

Zip1.FileStore.Add "c:\docs\test2.doc", True

' The following file will be encrypted using standard Zip

' encryption.

Zip1.FileStore.Add "c:\personal\test1.doc", True, "MyPassword", zipStandard

Zip1.FileStore.Add ("c:\text2.txt")

Zip1.FileStore.Add ("c:\text3.txt")

' In this example we want the files, once unzipped, to be read only

' so iterate through FileStore and set the Attributes to be sure that

' each file is read only

For i = 1 To Zip1.FileStore.Count

Zip1.FileStore(i).Attributes.ReadOnlyFile = True

Next

' Zip the files

Zip1.FileStore.Zip ("c:\zipped\zippedfiles.zip")

MsgBox ("Done!")

Exit Sub

onError:

MsgBox ("Error " & Err.Description)

End Sub

ASP (VB Script) Example

if Request.Querystring("file") = "" then

On Error Resume Next

' Create an instance of the zip component

Dim Zip1

Set Zip1 = Server.CreateObject("Dart.Zip.1")

Zip1.BackgroundOperation = zipNone

' For use in IIS, be sure DoEvents is false

Zip1.DoEvents = False

' Load the zip file, this populates the FileStore

Zip1.Load("testfile.zip")

'Save session of Zip object

Session("Zip") = Zip1

'Display as hyperlinks in table, these can be used to extract

'individual files.

Response.Write("<table><tr><td colspan = 2>")

Response.Write("Click 'Download' to download a file contained within testfile.zip")

Response.Write("</td></tr>")

For i = 1 to Zip1.Filestore.Count

Response.Write("<tr>")

Response.Write("<td>")

Response.Write(Zip1.Filestore.Item(i).Name)

Response.Write("</td>")

Response.Write("<td>")

' Create link pointing to current page with a querystring.

' When this is clicked, a GET will be performed on the current

' page. The querystring variable will be retrieved as well as

' the Zip object from the session. The querystring file

' variable can then be used as an indexer into the FileStore.

' Then the response to the browser can be made the file.

Response.Write("<a href='thispage.asp?file=" & i & ">Download</a>")

Response.Write("</td>")

Response.Write<"</tr>")

Next

Response.Write("</table>")

else

' One of the links in the table above was clicked

Dim Zip1

Dim stream

Dim index

' Get the Zip object from the Session.

Zip1 = Session("Zip")

' Create a DartStream to be unzipped into.

stream = Server.CreateObject("Dart.DartStream")

' Get the index from the querystring.

index = Request.QueryString("file")

' Extract the file requested into the stream

Zip1.FileStore.Item(index).Extract(stream)

'Now send the unzipped file as the response to the browser

' Change content type to octet/stream

Response.ContentType = "application/octet-stream"

' Change disposition so that save as box has correct name

Response.AddHeader "Content-Disposition", Zip1.Filestore.Item(index).Name

' Send binary bytes

Response.BinaryWrite stream.ReadBytes()

end if


FileStore Property Example (Zip Control)

Visual Basic Example

Private Sub Command1_Click()

On Error GoTo onError

' Add files to be zipped to the FileStore, after which each will be

' represented by a File Object.

' The following files will all keep their directory structure because

' the PreservePath parameter is True

Zip1.FileStore.Add "c:\images\image1.bmp", True

Zip1.FileStore.Add "c:\images\image2.bmp", True

Zip1.FileStore.Add "c:\docs\test1.doc", True

Zip1.FileStore.Add "c:\docs\test2.doc", True

' The following file will be encrypted using standard Zip

' encryption.

Zip1.FileStore.Add "c:\personal\test1.doc", True, "MyPassword", zipStandard

Zip1.FileStore.Add ("c:\text2.txt")

Zip1.FileStore.Add ("c:\text3.txt")

' In this example we want the files, once unzipped, to be read only

' so iterate through FileStore and set the Attributes to be sure that

' each file is read only

For i = 1 To Zip1.FileStore.Count

Zip1.FileStore(i).Attributes.ReadOnlyFile = True

Next

' Zip the files

Zip1.FileStore.Zip ("c:\zipped\zippedfiles.zip")

MsgBox ("Done!")

Exit Sub

onError:

MsgBox ("Error " & Err.Description)

End Sub

ASP (VB Script) Example

if Request.Querystring("file") = "" then

On Error Resume Next

' Create an instance of the zip component

Dim Zip1

Set Zip1 = Server.CreateObject("Dart.Zip.1")

Zip1.BackgroundOperation = zipNone

' For use in IIS, be sure DoEvents is false

Zip1.DoEvents = False

' Load the zip file, this populates the FileStore

Zip1.Load("c:\testfile.zip")

'Save session of Zip object

Session("Zip") = Zip

'Display as hyperlinks in table, these can be used to extract

'individual files.

Response.Write("<table><tr><td colspan = 2>")

Response.Write("Click 'Download' to download a file contained within testfile.zip")

Response.Write("</td></tr>")

For i = 1 to Zip1.Filestore.Count

Response.Write("<tr>")

Response.Write("<td>")

Response.Write(Zip1.Filestore.Item(i).Name)

Response.Write("</td>")

Response.Write("<td>")

' Create link pointing to current page with a querystring.

' When this is clicked, a GET will be performed on the current

' page. The querystring variable will be retrieved as well as

' the Zip object from the session. The querystring file

' variable can then be used as an indexer into the FileStore.

' Then the response to the browser can be made the file.

Response.Write("<a href='thispage.asp?file=" & i & ">Download</a>")

Response.Write("</td>")

Response.Write<"</tr>")

Next

Response.Write("</table>")

else

if Request.QueryString("file") <> "" then

' One of the links in the table above was clicked

Dim Zip1

Dim stream

Dim index

' Get the Zip object from the Session.

Zip1 = Session("Zip")

' Create a DartStream to be unzipped into.

stream = Server.CreateObject("Dart.DartStream")

' Get the index from the querystring.

index = Request.QueryString("file")

' Extract the file requested into the stream

Zip1.FileStore.Item(index).Extract(stream)

'Now send the unzipped file as the response to the browser

' Change content type to octet/stream

Response.ContentType = "application/octet-stream"

' Change disposition so that save as box has correct name

Response.AddHeader "Content-Disposition", Zip1.Filestore.Item(index).Name

' Send binary bytes

Response.BinaryWrite stream.ReadBytes()

end if

end if


Progress Event Example (Zip Control)

Private Sub Form_Load()

' Set Progress event to fire every 512k

Zip1.ProgressSize = 512

' Begin a zip operation

Zip1.QuickZip "c:\test1.txt", "c:\test1.zip"

End Sub

Private Sub Zip1_Progress(Status As ZipStatusConstants, File As File, FileNumber As Long, FileBytes As Long, TotalBytes As Long)

Dim s As String

s = "Current Operation : "

' Get current operation and display

Select Case Status

Case zipBeginZip

s = s & "Beginning Zip Compression for " & File

Case zipZipping

s = s & "Compressing Data for " & File

Case zipEndZip

s = s & "Finishing Zip Compression for " & File

Case zipBeginUnzip

s = s & "Beginning Zip Decompression for " & File

Case zipUnzipping

s = s & "Decompressing Data for " & File

Case zipEndUnzip

s = s & "Finishing Zip Decompression for " & File

Case zipTesting

s = s & "Testing Compressed File for " & File

Case zipFixing

s = s & "Attempting To Fix A Corrupt File for " & File

End Select

' Display amount of kilobytes processed for each file

s = s & vbCrLf & FileBytes & " uncompressed kilobytes of " & File.Size

lblOperation.Caption = s

' Display amount of kilobytes processed for entire collection

lblTotal.Caption = "Total Progress " & TotalBytes & " uncompressed kilobytes of " & Zip1.FileStore.TotalBytes

End Sub


ProgressSize Property Example (Zip Control)

Private Sub Form_Load()

' Set Progress event to fire every 512k

Zip1.ProgressSize = 512

' Begin a zip operation

Zip1.QuickZip "c:\test1.txt", "c:\test1.zip"

End Sub

Private Sub Zip1_Progress(Status As ZipStatusConstants, File As File, FileNumber As Long, FileBytes As Long, TotalBytes As Long)

Dim s As String

s = "Current Operation : "

' Get the current operation and display

Select Case Status

Case zipBeginZip

s = s & "Beginning Zip Compression for " & File

Case zipZipping

s = s & "Compressing Data for " & File

Case zipEndZip

s = s & "Finishing Zip Compression for " & File

Case zipBeginUnzip

s = s & "Beginning Zip Decompression for " & File

Case zipUnzipping

s = s & "Decompressing Data for " & File

Case zipEndUnzip

s = s & "Finishing Zip Decompression for " & File

Case zipTesting

s = s & "Testing Compressed File for " & File

Case zipFixing

s = s & "Attempting To Fix A Corrupt File for " & File

End Select

' Display amount of kilobytes processed for each file

s = s & vbCrLf & FileBytes & " uncompressed kilobytes of " & File.Size

lblOperation.Caption = s

' Display amount of kilobytes processed for entire collection

lblTotal.Caption = "Total Progress " & TotalBytes & " uncompressed kilobytes of " & Zip1.FileStore.TotalBytes

End Sub


QuickUnzip Method Example (Zip Control)

Visual Basic Example

Private Sub Unzipfile(FileToUnzip as String, OutputDir as String, Pass as String)

On Error goto OnError

' Attempt to unzip file using QuickUnzip method

Zip1.QuickUnzip FileToUnzip, OutputDir, true, true, Pass

Exit Sub

On Error:

msgbox(Err.Number & ":" & Err.Description)

End Sub

ASP (VB Script Example)

On Error Resume Next

' Create an instance of the zip component

Dim Zip1

Set Zip1 = Server.CreateObject("Dart.Zip.1")

Zip1.BackgroundOperation = zipNone

' For use in IIS, be sure DoEvents is false

Zip1.DoEvents = False

Zip1.QuickUnzip "file1.zip", "C:\zipped\", true, true

if err = 0 then

Response.Write("Unzip Successful")

else

Response.Write("Error in unzip operation")

end if


QuickZip Method Example (Zip Control)

Visual Basic Example

The following code snippets demonstrate several ways the QuickZip Method can be used.

'To Zip a single file

Zip1.QuickZip "c:\file1.txt", "C:\zipped\file1.zip"

'To Zip more than one file

Zip1.QuickZip "c:\file1.txt,c:\file2.txt", "C:\zipped\files.zip"

'To Zip all files in a directory called C:\Files. Because IncludeSubs is

'true, all directories below c:\Files will also be included in the zip

'operation, and because PreservePath is true, the directory structure

'below C:\Files will be the unchanged.

Zip1.QuickZip "c:\Files\*", "C:\zipped\files.zip", True, True

'To Zip and encrypt all text files in C:\Personal. Again, IncludeSubs and

'PreservePath are true

Zip1.QuickZip "C:\Personal\*.txt", "C:\zipped\personal.zip", True, True, "mypass", zipStandard

ASP (VB Script) Examples

<%

'This ASP Example demonstrates zipping a local file which is specified

'by a form submission, zipping this file, and archiving it on the server.

'This example also demonstrates disabling events for use in IIS.

if Request.Form("LocalFileName") <> "" then

' The form was submitted with a value for LocalFileName,

' zip and archive

On Error Resume Next

' Create an instance of the zip component

Dim Zip1

Set Zip1 = Server.CreateObject("Dart.Zip.1")

' Retrieve the filename(s) to archive

Dim FileName

FileName = Request.Form("LocalFileName")

Zip1.BackgroundOperation = zipNone

' For use in IIS, be sure DoEvents is false

Zip1.DoEvents = False

' Create file name for the archive based on the date

Dim ArchivedFile

ArchivedFile = DateValue(Now())

ArchivedFile = Replace(ArchivedFile, "/", "_")

' Zip the file(s) and report.

Zip1.QuickZip FileName, "C:\archive\" & ArchivedFile & ".zip"

if err = 0 then

Response.Write(FileName & " successfully archived.")

else

Response.Write("An error occurred during the archive attempt.")

end if

end if

%>


Threading Model

Most PowerTCP Controls are marked as Apartment Model Threaded. PowerTCP Controls contain multi-threaded protection for all global and static variables, making it safe for use in applications that use the same component in multiple Single Thread Apartments (STAs).

Single-threaded Applications

Most application developers develop single-threaded applications (the application has only one STA). Most of the sample applications included with PowerTCP Controls are written using this model. When Timeout is greater than 0, the communication components process Windows messages for the thread, allowing the user interface and all other windows to function normally.

Multi-threaded Applications

In Visual Basic you can make a multi-threaded application by creating an ActiveX executable with special objects that are created using CreateObject(). The WebServer application, included with the PowerTCP Winsock Tool, was written using this technique. Each connection is managed within a unique STA, so busy threads do not interfere with the main STA that processes user interface messages and windows.

When you use PowerTCP on Active Server Pages, each page operates within its own STA, making IIS a multi-threaded application.

Within Visual C++, you can likewise create multiple STAs for your application, and safely use one or more PowerTCP Controls within each STA.


PowerTCP Distribution

This topic covers:

  • System File Updates

  • Winsock version 2 System Support

  • PowerTCP Components

  • Distribution under Internet Information Server

  • Troubleshooting

System File Updates

Windows 95

DCOM95 version 1.3 must be installed before installing PowerTCP DLLs. You can redistribute DCOM95 with your product so your users can install it. Obtain DCOM95 from www.microsoft.com/com/dcom/dcom95/download.asp .

Windows 98

DCOM98 version 1.3 must be installed before installing PowerTCP DLLs. Microsoft does not allow redistribution of DCOM98, so your users will need to obtain it from www.microsoft.com/com/dcom/dcom98/download.asp .

Windows NT4

Your system must be updated to a level of at least Service Pack 3 (the Secure DLL requires SP4) before installing PowerTCP DLLs. You must update the following OLE system files to the following levels:

DLL | Version
OLEAUT32.DLL | 2.40.4275 (or higher)
STDOLE2.TLB | 2.40.4275 (or higher)
ASYCFILT.DLL | 2.40.4275 (or higher)
OLEPRO32.DLL | 2.40.4275 (or higher)
COMCAT.DLL | 4.71 (or higher)

System updates are performed using the 4275-Ole.exe file, which is located in the Bin directory in your PowerTCP Tool install root directory. You can redistribute this file to your users. Note This system update file will not run under Win95/98.

Windows 2000

Windows 2000 requires no system file updates.

Windows XP

Windows XP requires no system file updates.

Back to Top

Winsock version 2 System Support

Windows 95 ships with Winsock version 1; all other operating systems (Win98/2000/NT/XP) ship with version 2. Version 2 is only required by applications that use raw datagrams and multicast features. Dart's Ping Control and UDP Control (multicast feature) are the only products that require version 2. This update was last available at www.microsoft.com/windows95/downloads/contents/wuadmintools/s_wunetworkingtools/w95sockets2/.

PowerTCP links to Winsock version 1, but the operating system redirects these calls to version 2 (if installed). Therefore, performance is optimal (no performance degradation occurs due to linking to Winsock version 1), while still allowing PowerTCP to be installed on Windows 95 systems that have not been updated to version 2.

If you use raw or multicast datagrams, make sure Winsock version 2 is available on your deployment platforms.

Back to Top

PowerTCP Components

Refer to each PowerTCP Control main topic in this Help system for a list of dependent DLLs. For example, DartFtp.dll (containing the FTP Control) is dependent upon DartSock.dll for all communications. You must install both DLLs when you distribute your application. Each DLL ships with a .dep file that lists these dependencies.

PowerTCP DLLs must be registered. Most installation utilities will do this automatically; however, you can also use Regsvr32.exe. See System File Updates for more information on system file support before registering PowerTCP Tools.

The following table summarizes PowerTCP DLL dependencies:

DLL | Dependent Upon
DartSock.dll | None
DartRas.dll | DartSock.dll
DartUtil.dll | DartSock.dll
DartFtp.dll | DartSock.dll
DartFtpServer.dll | DartSock.dll, DartServer.dll, DartFtpUtil.dll
DartDnsServer.dll | DartSock.dll
DartTelnet.dll | DartSock.dll
DartSnmp2.dll | DartSock.dll
DartVt.dll | DartSock.dll
DartWeb.dll | DartSock.dll
DartMail.dll | DartSock.dll, DartUtil.dll
DartServer.dll | DartSock.dll
DartSecure2.dll | DartSock.dll, DartCertificate.dll
DartSecureMail.dll | DartSock.dll, DartSecure2.dll, DartCertificate.dll, DartMail.dll
DartSecureFtp.dll | DartSock.dll, DartSecure2.dll, DartCertificate.dll, DartFtp.dll
DartSecureFtpServer.dll | DartSock.dll, DartFtpUtil.dll, DartSecure2.dll
DartWebASP.dll | Wsock32.dll (Winsock v. 1.1), DartSock.dll, DartSecure2.dll, DartWebUtil.dll, DartCertificate.dll
DartWebServer.dll | DartSock.dll, DartServer.dll, DartSecure2.dll, DartWebUtil.dll, DartCertificate.dll
DartZip.dll | DartSock.dll

Back to Top

Distribution under Internet Information Server

If you are using PowerTCP under IIS and you have not installed a Serial Number, the product will work for 30 days as a Trial, but will then cease operation. Active Server Page deployment requires a Serial Number for each server because the environment checks for a development license each time a licensed control is used. If you deploy PowerTCP Tools for operation under IIS, install your development license into the registry as it appears on your development platform (check registry location HKEY_LOCAL_MACHINE / SOFTWARE / Dart / PowerTCP / License to see what should be installed).

For most compiled applications, your PowerTCP Serial Number is automatically included when you compile, so no special license considerations are necessary. The only exception is Dart's C++ wrapper, in which the Create method takes your development license as a parameter.

Back to Top

Troubleshooting

If you receive "not licensed for distribution" messages, try removing the control from your project and then re-inserting it. If a trial was already installed and used to build a project, some development environments cache the licensing information even after registering the control. Refer to environment–specific readme.txt files for more information.

Back to Top


PowerTCP Licensing

PowerTCP License Installation

Your PowerTCP License Agreement provides you with a single-seat development license and the right to distribute PowerTCP controls with NO ROYALTIES of any kind. Some PowerTCP objects are marked as licensed. This topic covers:

  • Trial Installation

  • Installing a Fully Licensed PowerTCP Tool

  • Re-installing a PowerTCP Tool

  • License Details

  • Special Notes on Tested Development Environments

Trial Installation

Installing a PowerTCP Tool as a fully–functional trial involves running the setup program (available from www.dart.com) without completing the Registration process. The trial will operate for 30 days after installation. Proceed to step 2 of Installing a Fully Licensed PowerTCP Tool when you are ready to license the product.

Back to Top

Installing a Fully Licensed PowerTCP Tool

Once you have downloaded the latest version, complete the following steps to register your PowerTCP Tool:

  1. From the Start menu, point to Programs, point to PowerTCP, point to the PowerTCP Tool you downloaded, and then click Registration.

  2. In the PowerTCP Registration dialog box, click Register.

  3. Enter your Serial Number, First Name, Last Name, and Organization information.

  4. Click Next.

  5. Enter your Email Address, Purchased From, and Purchased Date information.

  6. Click Next.

  7. Verify that the information is correct, and then click Next.

  8. When the registration process is complete, click Exit. (Note Clicking Done at this step displays your currently registered PowerTCP Tools. Click Exit to end the complete the registration process and close the dialog box.)

If you do not have Internet Access on your development machine, please follow these instructions:

  1. From the Start menu, point to Programs, point to PowerTCP, point to the PowerTCP Tool you downloaded, and then click Registration.

  2. In the PowerTCP Registration dialog box, click Edit.

  3. In the Currently Registered Products area, write down the number in the Key field (the fields appears dimmed).

  4. On a machine that has Internet access, log on to the Dart registration page (http://www.dart.com/register/).

  5. Enter all required information. Required information is bolded. Key is the number you wrote down in Step 3 above.

  6. Click Submit. A seven-digit registration code appears.

  7. On your machine (the machine on which you completed Steps 1-3), if necessary, access the PowerTCP Registration dialog box to display the Currently Registered Products area containing the Key number.

  8. Enter your serial number and the seven-digit registration number you obtained in Step 6.

  9. Click Update.

  10. Click Exit.

After either of the two registration procedures are complete, your PowerTCP Tool appears in the Registered Tools field of the registration form. Make sure you recompile your application after you register the PowerTCP Tool. For distribution instructions specific to your development environment, please view the Readme file. The Readme file is located in the Samples directory; for example, to locate the Readme file for the Winsock Tool in VB6, use the following path: Start>Programs>PowerTCP>WinsockTool>VB Samples>VB6>Readme.

If you do not register your PowerTCP Tool at this point, it will operate as a trial. Remember to distribute with your applications any necessary PowerTCP files and any dependent files. Dependent files are listed in the Introduction topic for each PowerTCP Control, and must be installed on each target system. See Distribution for more information on system requirements.

Back to Top

Re-installing a PowerTCP Tool

The Key provided by the Registration Program is derived from a system number that is changed when the C: drive is reformatted. If you reformat your hard disk, and need to re-install your PowerTCP Tool, follow the steps in Installing a Fully Licensed PowerTCP Tool. You will be prompted to complete a License Transfer form, and a new Registration Number will be generated.

If you need to re-install more than once, you will be prompted to complete a License Transfer form that will be sent to your sales representative for approval. Within two working days Dart will reset your Serial Number and notify you when you can re-register your product. The product will operate as a trial for up to 30 days.

Back to Top

License Details

When you insert a PowerTCP control into a project, most development environments verify that the control is licensed for development. The control will work if you correctly entered the PowerTCP Tool Serial Number. See Installing a Fully Licensed PowerTCP Tool for more information. When you compile your application, the development environment requests this Serial Number and embeds it in the application. When users run your application, the application submits this Serial Number to the control and the Serial Number is checked for validity. If the Serial Number is correct, then the application runs. This verification process occurs automatically.

Back to Top

Special Notes on Tested Development Environments

  • Visual Basic checks for a Serial Number when a PowerTCP control is first inserted on a form or first shown on a form. When a PowerTCP control is loaded as a reference and is dynamically instantiated (for example, Dim Tcp as New Tcp), the Serial Number is similarly checked.

  • Visual C++ obtains the Serial Number when you first insert a PowerTCP control on a form, and caches that number as a dialog resource. For this reason, Dart ships Visual C++ samples without inserted controls. You will need to insert them before you compile any of the samples. See the readme.txt file for more information. Information on dynamically creating objects using ClassFactory2 is included. License caching is MFC only; for our new C++ classes, you must specify the License as a parameter in the Create method.

  • Active Server Page deployment requires a Serial Number for each server because the environment checks for a development license each time a licensed control is used. If you deploy PowerTCP Tools for operation under IIS, install your development license into the registry as it appears on your development platform (check registry location HKEY_LOCAL_MACHINE / SOFTWARE / Dart / PowerTCP / License to see what should be installed). PowerTCP is royalty-free, including under IIS.

  • PowerBuilder also caches licensing information. See the readme.txt file for instructions on how to compile the sample applications.

  • Excel will cache licensing information when the control is originally inserted, so your spreadsheet will carry this information forward to any deployment platforms.

  • Delphi has special requirements. Before you can use the sample applications you MUST add the PowerTCP Tools that are in the sample to the Component Library. Refer to the readme.txt file for specific instructions.

  • C++ Builder is similar to Delphi. See the readme.txt file for specific instructions.

Back to Top


PowerTCP Support

Note Visit the Dart Support Forum to share ideas with PowerTCP users worldwide. This forum is monitored by the Dart support staff.

Dart offers the following six support options:

Program

Description

Length

Free Introductory Support

Includes:

  • Email support covering installation issues

  • Tool usage and application

  • Distribution

30 days after purchase

Solution Support

PowerTCP functions as a vital bridge between the desktop and other enterprise resources. Dart can help you implement this bridge by tailoring our software engineering and development services to your needs.

Pricing for Solution Support is available by quote. Please contact your sales representative.

Standard Support

Includes:

  • Unlimited email and fax support covering installation issues, tool usage and application, and deployment.

  • Email notification of free tool updates provided via web download.

  • Special incentives on new products and services.

A discount is available if purchased with the corresponding PowerTCP Tool.

One year - renewable

Priority Support

Includes:

  • Unlimited telephone, email, and fax support covering installation issues, tool usage and application, and deployment.

  • Limited code review and analysis upon request.

  • Free major version product upgrades.

  • Email notification of free tool updates provided via web download.

  • Special incentives on new products and services.

A discount is available if purchased with the corresponding PowerTCP Tool.

One year - renewable

ISV Support

Includes:

  • Unlimited telephone, email, and fax support covering installation issues, tool usage and application, and deployment.

  • Code review and analysis upon request.

  • Free major version product upgrades.

  • Email notification of free tool updates provided via web download.

  • Priority telephone access to senior support representatives.

  • Optional escrow account for software source code (Fort Knox).

  • Continued support for previously released major versions.

  • Guaranteed response within four hours of notification during business hours (M-F, 8:30-5:30 EST).

  • Interoperability resolution within five business days of notification.

Please contact your sales representative about this special program.

One year - renewable

Team Support

Team support extends ISV Support benefits to teams of developers who routinely use PowerTCP Tools.

One year - renewable