⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 catalog.frm

📁 实现对磁盘的扫描程序
💻 FRM
字号:
VERSION 4.00
Begin VB.Form Form1 
   Caption         =   "Catalog Disk"
   ClientHeight    =   5955
   ClientLeft      =   1995
   ClientTop       =   1650
   ClientWidth     =   7470
   Height          =   6360
   Left            =   1935
   LinkTopic       =   "Form1"
   ScaleHeight     =   5955
   ScaleWidth      =   7470
   Top             =   1305
   Width           =   7590
   Begin VB.ListBox List2 
      Height          =   3570
      Left            =   480
      Sorted          =   -1  'True
      TabIndex        =   5
      Top             =   1560
      Width           =   6495
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Catalog Now"
      Height          =   615
      Left            =   2880
      TabIndex        =   4
      Top             =   720
      Width           =   1455
   End
   Begin VB.DriveListBox Drive1 
      Height          =   315
      Left            =   2160
      TabIndex        =   3
      Top             =   120
      Width           =   2895
   End
   Begin VB.DirListBox Dir1 
      Height          =   480
      Left            =   840
      TabIndex        =   2
      Top             =   5280
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.FileListBox File1 
      Height          =   450
      Left            =   2640
      TabIndex        =   1
      Top             =   5280
      Visible         =   0   'False
      Width           =   1935
   End
   Begin VB.ListBox List1 
      Height          =   450
      Left            =   5160
      TabIndex        =   0
      Top             =   5280
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.Label Label1 
      Height          =   255
      Left            =   5040
      TabIndex        =   6
      Top             =   1200
      Width           =   1935
   End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Sub Command1_Click()

'Clear lists

List1.Clear
List2.Clear


'Set path to root directory

Dir1.Path = Left$(Drive1.Drive, 2) + "\"

File1.Path = Dir1.Path  'Set file path


'Add files in root directory to catalog

For t& = 0 To File1.ListCount - 1
    List2.AddItem Dir1.Path + File1.List(t&)
Next


'Add initial subdirectories in root
For t& = 0 To Dir1.ListCount - 1
    List1.AddItem Dir1.List(t&)
Next

If t& = 0 Then GoTo finishedpoint 'No subdirectories, we're done.


cnt& = 0  'Start with first directory in list

startpoint:

Dir1.Path = List1.List(cnt&)
File1.Path = Dir1.Path

'Add any subdirectories found

For t& = 0 To Dir1.ListCount - 1
    List1.AddItem Dir1.List(t&)
Next


'Now add files found...
For t& = 0 To File1.ListCount - 1
    List2.AddItem Dir1.Path + "\" + File1.List(t&)
Next

'Increment count
cnt& = cnt& + 1
If cnt& < List1.ListCount Then GoTo startpoint


finishedpoint:

label1.Caption = "Total:" + Str$(List2.ListCount)

End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -