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

📄 form1.frm

📁 delphi 做的监控文件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "中级:监控目录路径的变动"
   ClientHeight    =   5265
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7425
   LinkTopic       =   "Form1"
   ScaleHeight     =   5265
   ScaleWidth      =   7425
   StartUpPosition =   3  '窗口缺省
   Begin VB.CheckBox Check1 
      Caption         =   "监控子目录"
      Height          =   375
      Left            =   120
      TabIndex        =   6
      Top             =   3600
      Width           =   1335
   End
   Begin VB.ListBox List1 
      Height          =   3480
      Left            =   2160
      TabIndex        =   5
      Top             =   120
      Width           =   5175
   End
   Begin VB.DirListBox Dir1 
      Height          =   3030
      Left            =   120
      TabIndex        =   4
      Top             =   480
      Width           =   1935
   End
   Begin VB.DriveListBox Drive1 
      Height          =   300
      Left            =   120
      TabIndex        =   3
      Top             =   120
      Width           =   1935
   End
   Begin VB.CommandButton Command3 
      Caption         =   "清除"
      Height          =   495
      Left            =   6240
      TabIndex        =   2
      Top             =   4680
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "停止"
      Height          =   495
      Left            =   5040
      TabIndex        =   1
      Top             =   4680
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "监控"
      Height          =   495
      Left            =   3840
      TabIndex        =   0
      Top             =   4680
      Width           =   1095
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "目录:"
      Height          =   180
      Left            =   120
      TabIndex        =   8
      Top             =   4080
      Width           =   540
   End
   Begin VB.Label Label3 
      Caption         =   "Label3"
      Height          =   255
      Left            =   720
      TabIndex        =   7
      Top             =   4080
      Width           =   5775
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Load()
    Drive1.Drive = "C:\"
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If TimerEnabled Then Call Terminate
End Sub

Private Sub Command1_Click()
    Dim SubTrees As Boolean
    
    If Not TimerEnabled Then
        SubTrees = IIf(Check1.Value = vbChecked, True, False)
        Call Init(Dir1.Path, SubTrees)
        Check1.Enabled = False
        Dir1.Enabled = False
        Drive1.Enabled = False
        Command1.Enabled = False
        Command2.Enabled = True
    End If
End Sub

Private Sub Command2_Click()
    If TimerEnabled Then
        Call Terminate
        Check1.Enabled = True
        Dir1.Enabled = True
        Drive1.Enabled = True
        Command1.Enabled = True
        Command2.Enabled = False
    End If
End Sub

Private Sub Command3_Click()
    List1.Clear
End Sub

Private Sub Drive1_Change()
    Dir1.Path = Drive1.Drive
End Sub

Private Sub Dir1_Change()
    Label3.Caption = Dir1.Path
End Sub

⌨️ 快捷键说明

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