home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "FileScan"
- ClientHeight = 3540
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 7350
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3540
- ScaleWidth = 7350
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command1
- Caption = "Scan Now"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 5655
- TabIndex = 3
- Top = 2895
- Width = 1575
- End
- Begin VB.FileListBox File1
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 3240
- Left = 2775
- TabIndex = 2
- Top = 150
- Width = 2715
- End
- Begin VB.DirListBox Dir1
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 2730
- Left = 120
- TabIndex = 1
- Top = 660
- Width = 2520
- End
- Begin VB.DriveListBox Drive1
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 330
- Left = 105
- TabIndex = 0
- Top = 150
- Width = 2520
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- ' ******************************
- ' ******************************
- ' ** MASTERING VB6 **
- ' ** by Evangelos Petroutos **
- ' ** SYBEX, 1998 **
- ' ******************************
- ' ******************************
- Dim InitialFolder
- Dim totalFiles As Integer
- Private Sub Command1_Click()
- ChDrive Drive1.Drive
- ChDir Dir1.Path
- InitialFolder = CurDir
- ScanFolders
- MsgBox "There are " & totalFiles & " under the " & InitialFolder & " folder"
- End Sub
- Sub ScanFolders()
- Dim subFolders As Integer
- totalFiles = totalFiles + File1.ListCount
- subFolders = Dir1.ListCount
- If subFolders > 0 Then
- For i = 0 To subFolders - 1
- ChDir Dir1.List(i)
- Dir1.Path = Dir1.List(i)
- File1.Path = Dir1.List(i)
- Form1.Refresh
- ScanFolders
- Next
- End If
- File1.Path = Dir1.Path
- MoveUp
- End Sub
- Sub MoveUp()
- If Dir1.List(-1) <> InitialFolder Then
- ChDir Dir1.List(-2)
- Dir1.Path = Dir1.List(-2)
- End If
- End Sub
- Private Sub Dir1_Change()
- ChDir Dir1.Path
- File1.Path = Dir1.Path
- End Sub
- Private Sub Drive1_Change()
- ChDrive Dir1.Path
- Dir1.Path = Drive1.Drive
- Dir1.Refresh
- End Sub
- Private Sub Form_Load()
- ChDrive App.Path
- ChDir App.Path
- End Sub
-