home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac
/
altd201a.zip
/
VB4032.ARJ
/
VB40.32
/
EX24VB.FRM
< prev
next >
Wrap
Text File
|
1996-04-19
|
9KB
|
292 lines
VERSION 4.00
Begin VB.Form Form1
Caption = "VB Example 24"
ClientHeight = 4665
ClientLeft = 1155
ClientTop = 1635
ClientWidth = 7260
Height = 5070
Left = 1095
LinkTopic = "Form1"
ScaleHeight = 4665
ScaleWidth = 7260
Top = 1290
Width = 7380
Begin VB.CommandButton UpdateZipComment
Caption = "Update ZIP Comment"
Height = 375
Left = 5280
TabIndex = 21
Top = 600
Width = 1815
End
Begin VB.CommandButton WriteDirectory
Caption = "Write Directory"
Height = 375
Left = 5280
TabIndex = 20
Top = 1080
Width = 1815
End
Begin VB.CommandButton UpdateFileComment
Caption = "Update File Comment"
Height = 375
Left = 5280
TabIndex = 19
Top = 120
Width = 1815
End
Begin VB.TextBox ArchiveComment
Height = 375
Left = 1920
TabIndex = 18
Text = "Archive Comment"
Top = 3240
Width = 1575
End
Begin VB.CommandButton Exit
Caption = "Exit"
Height = 375
Left = 3720
TabIndex = 17
Top = 1080
Width = 1335
End
Begin VB.CommandButton About
Caption = "About"
Height = 375
Left = 3720
TabIndex = 16
Top = 600
Width = 1335
End
Begin VB.TextBox Level
Height = 375
Left = 3840
TabIndex = 15
Text = "Level"
Top = 1680
Width = 1575
End
Begin VB.CheckBox Directory
Caption = "Directory"
Height = 375
Left = 3840
TabIndex = 14
Top = 4200
Width = 975
End
Begin VB.CheckBox Hidden
Caption = "Hidden"
Height = 375
Left = 3840
TabIndex = 13
Top = 3720
Width = 855
End
Begin VB.CheckBox System
Caption = "System"
Height = 375
Left = 3840
TabIndex = 12
Top = 3240
Width = 975
End
Begin VB.CheckBox Archive
Caption = "Archive"
Height = 375
Left = 3840
TabIndex = 11
Top = 2760
Width = 975
End
Begin VB.CheckBox ReadOnly
Caption = "ReadOnly"
Height = 375
Left = 3840
TabIndex = 10
Top = 2280
Width = 1095
End
Begin VB.TextBox TimeStamp
Height = 375
Left = 1920
TabIndex = 9
Text = "TimeStamp"
Top = 2760
Width = 1575
End
Begin VB.TextBox DateStamp
Height = 375
Left = 1920
TabIndex = 8
Text = "DateStamp"
Top = 2280
Width = 1575
End
Begin VB.TextBox crc
Height = 375
Left = 240
TabIndex = 7
Text = "crc"
Top = 4200
Width = 1575
End
Begin VB.TextBox Size
Height = 375
Left = 240
TabIndex = 6
Text = "Size"
Top = 3240
Width = 1575
End
Begin VB.TextBox CompressedSize
Height = 375
Left = 240
TabIndex = 5
Text = "CompressedSize"
Top = 3720
Width = 1575
End
Begin VB.TextBox Comment
Height = 375
Left = 240
TabIndex = 4
Text = "Comment"
Top = 2760
Width = 1575
End
Begin VB.TextBox FileName
Height = 375
Left = 240
TabIndex = 3
Text = "Text1"
Top = 2280
Width = 1575
End
Begin VB.ListBox Contents
Height = 2010
Left = 1800
TabIndex = 2
Top = 120
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "Read Archive"
Height = 375
Left = 3720
TabIndex = 1
Top = 120
Width = 1335
End
Begin VB.FileListBox File1
Height = 2010
Left = 120
Pattern = "*.zip"
TabIndex = 0
Top = 120
Width = 1575
End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Dim z() As ALZipDir
Dim LibraryHandle As Long
Private Sub About_Click()
frmAbout.Text1 = "EX24VB demonstrates the simplified interface. Double click on a"
frmAbout.Text1 = frmAbout.Text1 + " zip file to display its contents. Selecting individual"
frmAbout.Text1 = frmAbout.Text1 + " files shows the file's attributes. You can change the"
frmAbout.Text1 = frmAbout.Text1 + " file and archive comments by inputing a new comment and"
frmAbout.Text1 = frmAbout.Text1 + " pressing the Update File/ZIP Comment button, then pressing"
frmAbout.Text1 = frmAbout.Text1 + " Write Directory."
frmAbout.Show 1
End Sub
Private Sub Command1_Click()
Dim i As Integer
Dim count As Long
Dim error As Long
ALFreeDir z()
If File1.filename <> "" Then
Contents.Clear
ALReadDir z(), File1.filename, count, error
For i = 0 To count - 1
Contents.AddItem (z(i).name)
Next i
End If
'
' I'm not going to do a WriteDir, a Delete, or
' anything like that, so I'll just free up the
' archive handle right away
'
ArchiveComment.text = z(UBound(z, 1)).comment
End Sub
Private Sub Contents_Click()
Dim i As Integer
i = Contents.ListIndex
If i >= LBound(z, 1) And i <= UBound(z, 1) Then
filename.text = z(i).name
comment.text = z(i).comment
size.text = Str(z(i).size)
CompressedSize.text = Str(z(i).compressed_size)
crc.text = Hex$(Not z(i).crc)
Datestamp.text = Format(z(i).month, "00/") + Format(z(i).date, "00/") + Format(z(i).year, "0000")
TimeStamp.text = Format(z(i).hour, "00:") + Format(z(i).minute, "00:") + Format(z(i).second, "00")
If z(i).r <> 0 Then ReadOnly.Value = 1 Else ReadOnly.Value = 0
If z(i).a <> 0 Then Archive.Value = 1 Else Archive.Value = 0
If z(i).s <> 0 Then System.Value = 1 Else System.Value = 0
If z(i).h <> 0 Then Hidden.Value = 1 Else Hidden.Value = 0
If z(i).d <> 0 Then Directory.Value = 1 Else Directory.Value = 0
level.text = Str(z(i).level)
End If
End Sub
Private Sub Exit_Click()
Unload Form1
End
End Sub
Private Sub File1_DblClick()
Command1_Click
End Sub
Private Sub Form_Load()
ChDrive App.Path
ChDir App.Path
File1.Path = App.Path
LibraryHandle = LoadLibrary(DLLName)
ReDim z(0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
ALFreeDir z
FreeLibrary (LibraryHandle)
End Sub
Private Sub UpdateFileComment_Click()
Dim i As Integer
i = Contents.ListIndex
If i >= LBound(z, 1) And i <= UBound(z, 1) Then
z(i).comment = comment.text
End If
End Sub
Private Sub UpdateZipComment_Click()
z(UBound(z, 1)).comment = ArchiveComment.text
End Sub
Private Sub WriteDirectory_Click()
i = ALWriteDir(z())
End Sub