|Sample Visual Basic
Code to create an SDA
Where Cryptocx is an instance of a Cryptocx Control.
is a listbox that will contain all of the files and or directories
to include in the SDA.
'' Build up the list of Files/Dir to have in the Archive
'' They are separated by *
'' * was chosen as the separator as you are not able to have file
'' names or directory names with * in
Dim names As String
Dim i As Integer
names = ""
'' There are no files or directories specified to add to an archive
If lstSDA.ListCount < 1 Then
MsgBox "You must sepcify at least one file to add to an archive"
For i = 0 To lstSDA.ListCount - 1
names = Trim(lstSDA.List(i)) + "*" + names
'' Remove the last *
names = Mid(names, 1, Len(names) - 1)
'' Now create the SDA
Dim Cryptocx As New EasyByte_Software.Cryptocxv7
Cryptocx.LicenseKey = "DEMO"
'' Most of these properties are optional, you can just specify an empty string
Cryptocx.SourceFile = names
Cryptocx.ArchiveBackground = "c:\boats.bmp"
Cryptocx.ArchiveIcon = "c:\myicon.ico"
Cryptocx.ArchiveCaption = "My Archive"
Cryptocx.Password = "mypassword"
Cryptocx.ArchiveControlPosition = "bottom"
Cryptocx.ArchiveOpenExplorer = "no"
Cryptocx.ArchiveExecuteFile = ""
Cryptocx.DestinationFile = "C:\myarchive.exe"
x = Cryptocx.CreateArchive
'' See if the archive was created ok
If x = "TRUE" Then