| 1 |
VERSION 5.00 |
| 2 |
Begin VB.Form Form1 |
| 3 |
AutoRedraw = -1 'True |
| 4 |
Caption = "Form1" |
| 5 |
ClientHeight = 3150 |
| 6 |
ClientLeft = 60 |
| 7 |
ClientTop = 345 |
| 8 |
ClientWidth = 6570 |
| 9 |
BeginProperty Font |
| 10 |
Name = "MS Sans Serif" |
| 11 |
Size = 9.75 |
| 12 |
Charset = 0 |
| 13 |
Weight = 700 |
| 14 |
Underline = 0 'False |
| 15 |
Italic = 0 'False |
| 16 |
Strikethrough = 0 'False |
| 17 |
EndProperty |
| 18 |
LinkTopic = "Form1" |
| 19 |
ScaleHeight = 3150 |
| 20 |
ScaleWidth = 6570 |
| 21 |
StartUpPosition = 1 'CenterOwner |
| 22 |
End |
| 23 |
Attribute VB_Name = "Form1" |
| 24 |
Attribute VB_GlobalNameSpace = False |
| 25 |
Attribute VB_Creatable = False |
| 26 |
Attribute VB_PredeclaredId = True |
| 27 |
Attribute VB_Exposed = False |
| 28 |
|
| 29 |
Option Explicit |
| 30 |
|
| 31 |
'--------------------------------------------------------------- |
| 32 |
'-- Sample VB 6 code to drive zip32z64.dll |
| 33 |
'-- |
| 34 |
'-- Based on code contributed to the Info-ZIP project by Mike Le Voi |
| 35 |
'-- |
| 36 |
'-- See the Original VB example in a separate directory for |
| 37 |
'-- more information |
| 38 |
'-- |
| 39 |
'-- Use this code at your own risk. Nothing implied or warranted |
| 40 |
'-- to work on your machine :-) |
| 41 |
'--------------------------------------------------------------- |
| 42 |
'-- |
| 43 |
'-- The Source Code Is Freely Available From Info-ZIP At: |
| 44 |
'-- ftp://ftp.info-zip.org/pub/infozip/infozip.html |
| 45 |
'-- and |
| 46 |
'-- http://sourceforge.net/projects/infozip/ |
| 47 |
'-- |
| 48 |
'-- A Very Special Thanks To Mr. Mike Le Voi |
| 49 |
'-- And Mr. Mike White Of The Info-ZIP project |
| 50 |
'-- For Letting Me Use And Modify His Orginal |
| 51 |
'-- Visual Basic 5.0 Code! Thank You Mike Le Voi. |
| 52 |
'--------------------------------------------------------------- |
| 53 |
'-- |
| 54 |
'-- Contributed To The Info-ZIP Project By Raymond L. King |
| 55 |
'-- Modified June 21, 1998 |
| 56 |
'-- By Raymond L. King |
| 57 |
'-- Custom Software Designers |
| 58 |
'-- |
| 59 |
'-- Contact Me At: [email protected] |
| 60 |
'-- ICQ 434355 |
| 61 |
'-- Or Visit Our Home Page At: http://www.ntplx.net/~king |
| 62 |
'-- |
| 63 |
'--------------------------------------------------------------- |
| 64 |
|
| 65 |
'--------------------------------------------------------------- |
| 66 |
' Zip32z64.dll is the new Zip32.dll based on Zip 3.0 and compiled |
| 67 |
' with Zip64 support enabled. See windll.txt in the windll directory |
| 68 |
' for more on Zip32z64 and the comments in VBZipBas.bas. |
| 69 |
' |
| 70 |
' Contact Info-Zip if problems. This code is |
| 71 |
' provided under the Info-Zip license. |
| 72 |
' |
| 73 |
' 4/24/2004, 12/4/2007 EG |
| 74 |
'--------------------------------------------------------------- |
| 75 |
|
| 76 |
Private Sub Form_Click() |
| 77 |
|
| 78 |
Dim retcode As Integer ' For Return Code From ZIP32.DLL |
| 79 |
Dim iFiles As String |
| 80 |
Dim FilesToZip() As String |
| 81 |
Dim i As Long |
| 82 |
|
| 83 |
Cls |
| 84 |
|
| 85 |
'-- Set Options - Only The Common Ones Are Shown Here |
| 86 |
'-- These Must Be Set Before Calling The VBZip32 Function |
| 87 |
|
| 88 |
' In VB 6 you can see the list of possible options and the defaults |
| 89 |
' by adding a space between any parameters which should make the tip box |
| 90 |
' appear. Delete a := and retype to see a list of choices. |
| 91 |
|
| 92 |
' Be warned: There are bugs in the previous dll. See the Original VB |
| 93 |
' example in the VB directory for details. |
| 94 |
|
| 95 |
If Not SetZipOptions(ZOPT, _ |
| 96 |
ZipMode:=Add, _ |
| 97 |
CompressionLevel:=c6_Default) Then |
| 98 |
' Some additional options ... |
| 99 |
' RootDirToZipFrom:="", _ |
| 100 |
' strip paths and just store names: |
| 101 |
' JunkDirNames:=False, _ |
| 102 |
' do not store entries for the directories themselves: |
| 103 |
' NoDirEntries:=True _ |
| 104 |
' include files only if match one of these patterns: |
| 105 |
' i_IncludeFiles:="*.vbp *.frm", _ |
| 106 |
' exclude files that match these patterns: |
| 107 |
' x_ExcludeFiles:="*.bas", _ |
| 108 |
' Verboseness:=Verbose, _ |
| 109 |
' IncludeEarlierThanDate:="2004-4-1", _ |
| 110 |
' RecurseSubdirectories:=r_RecurseIntoSubdirectories, _ |
| 111 |
' Encrypt:=False, _ |
| 112 |
' ArchiveComment:=False |
| 113 |
' date example (format mmddyyyy or yyyy-mm-dd): |
| 114 |
' ExcludeEarlierThanDate:="2002-12-10", _ |
| 115 |
' split example (can only create, can't update split archives in VB): |
| 116 |
' SplitSize:="110k", _ |
| 117 |
' Delete |
| 118 |
' If Not SetZipOptions(ZOPT, _ |
| 119 |
' ZipMode:=Delete) Then |
| 120 |
|
| 121 |
' a problem if get here - error message already displayed so just exit |
| 122 |
Exit Sub |
| 123 |
End If |
| 124 |
|
| 125 |
|
| 126 |
'-- Select Some Files - Wildcards Are Supported |
| 127 |
'-- Change The Paths Here To Your Directory |
| 128 |
'-- And Files!!! |
| 129 |
|
| 130 |
' default to current (VB project) directory and zip up project files |
| 131 |
zZipArchiveName = "MyFirst.zip" |
| 132 |
|
| 133 |
|
| 134 |
' Files to zip - use one of below |
| 135 |
|
| 136 |
'--------------- |
| 137 |
' Example using file name array |
| 138 |
|
| 139 |
' Store the file paths |
| 140 |
' Change Dim of zFiles at top of VBZipBas.bas if more than 100 files |
| 141 |
' See note at top of VBZipBas.bas for limit on number of files |
| 142 |
|
| 143 |
' zArgc = 2 ' Number Of file paths below |
| 144 |
' zZipFileNames.zFiles(1) = "*.bas" |
| 145 |
' zZipFileNames.zFiles(2) = "*.frm" |
| 146 |
|
| 147 |
'--------------- |
| 148 |
' Example using file list string |
| 149 |
|
| 150 |
' List of files to zip as string of names with space between |
| 151 |
' Set zArgc = 0 as not using array |
| 152 |
' Using string for file list avoids above array limit |
| 153 |
|
| 154 |
zArgc = 0 |
| 155 |
' ReDim FilesToZip(1) ' dim to number of files below |
| 156 |
' FilesToZip(1) = "x:*.*" |
| 157 |
ReDim FilesToZip(2) ' dim to number of files below |
| 158 |
FilesToZip(1) = "*.bas" |
| 159 |
FilesToZip(2) = "*.frm" |
| 160 |
|
| 161 |
' Build string of file names |
| 162 |
' Best to put double quotes around each in case of spaces |
| 163 |
strZipFileNames = "" |
| 164 |
For i = 1 To UBound(FilesToZip) |
| 165 |
strZipFileNames = strZipFileNames & """" & FilesToZip(i) & """ " |
| 166 |
Next |
| 167 |
'--------------- |
| 168 |
|
| 169 |
'-- Go Zip Them Up! |
| 170 |
retcode = VBZip32() |
| 171 |
|
| 172 |
'-- Display The Returned Code Or Error! |
| 173 |
Print "Return code:" & Str(retcode) |
| 174 |
|
| 175 |
End Sub |
| 176 |
|
| 177 |
Private Sub Form_Load() |
| 178 |
|
| 179 |
Me.Show |
| 180 |
|
| 181 |
Print "Click me!" |
| 182 |
|
| 183 |
End Sub |