EasyByte Software

Welcome to EasyByte Software

Home Buy Online Products Downloads Support
Sections
Index
About
Installation
Properties
Methods
ASP and dotNET
Further Information
  

 

 

ZIPCreateZIP Method
 
     

Cryptocx v7 User Guide

 

ZIPCreateZIP Method

This is the method that you use to create a compressed ZIP file, from a given list of files and folders. The resultant zip file can be loaded up with any common zip file reader.

 

Description

Create a ZIP file

     
Syntax

x = object.ZIPCreateZip

The syntax of the ZIPCreateZIP method has these parts:

 
Part Description
object A Cryptocx v7 control.
x A string that becomes either "TRUE" or "Error: xxx" where xxx is the error message.

       
Remarks You can load the resultant zip file up with any common zip file reader.

The properties you can set when creating a ZIP file are:

Required - SourceFile
Required - DestinationFile

       
Returns

String

     
Example Sample Visual Basic Code to create a ZIP file

Where Cryptocx is an instance of a Cryptocx Control.

Where lstFiles is a listbox that will contain all of the files and or directories to include in the ZIP.

 

''
'' Create the Zip file
''

'' Build up the list of Files/Dir to have in the Archive
''
'' They are separated by *
''

Dim names As String
Dim i As Integer
Dim theResult As String

names = ""

'' There are no files or directories specified to add to a zip file, so can't proceed
''

If lstFiles.ListCount < 1 Then
  GoTo eds
End If


For i = 0 To lstFiles.ListCount - 1
names = Trim(lstFiles.List(i)) + "*" + names
Next i

'' Remove the last *
''

names = Mid(names, 1, Len(names) - 1)



'' Now tell Cryptocx to create the Zip
''

Dim Cryptocx As New EasyByte_Software.Cryptocxv7

Cryptocx.LicenseKey = "DEMO"

Cryptocx.SourceFile = names
Cryptocx.DestinationFile = txtZipFile.Text

theResult = Cryptocx.ZIPCreateZIP


'' Check to see what has happened (if the compression went ok without errors)
''

If theResult = "TRUE" Then
  '' Ok, the Compression went well with no errors and the zip file was created
Else
  MsgBox theResult
End If


'' Free up Memory Resources
''

Set Cryptocx = Nothing

eds:

 

 

 

 

Back to Contents Page

 

Click here to set this great site as your home page

Or click here to add it to your Favorites.

  
  
 

Copyright (c) EasyByte Software 1998-2008, info@easybyte.com