EasyByte Software

Welcome to EasyByte Software

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

 

 

TARCreateTAR Method
 
     

Cryptocx v7 User Guide

 

TARCreateTAR Method

This is the method that you use to create a TAR archive file, from a given list of files and folders. The resultant TAR file can be loaded up with any standards compliant TAR file reader.

 

Description

Create a TAR file

     
Syntax

x = object.TARCreateTAR

The syntax of the TARCreateTAR 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 tar file up with any common tar file reader.

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

Required - SourceFile
Required - DestinationFile

       
Returns

String

     
Example Sample Visual Basic Code to create a TAR 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 TAR.

 

''
'' Create the TAR 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 tar 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 Tar
''

Dim Cryptocx As New EasyByte_Software.Cryptocxv7

Cryptocx.LicenseKey = "DEMO"

Cryptocx.SourceFile = names
Cryptocx.DestinationFile = txtTarFile.Text

theResult = Cryptocx.TARCreateTAR


'' 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 tar 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