Vbzipfrm.frm 5.9 KB

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