watcher.IncludeSubDirectories=true /厅运/此属扮团梁性置为true允许监控子目录
其他几个比较关键的,
Filter用于管理要监控的文件类型或桐,如链接库"*.dll"
NotifyFilter用于管理要监控的改变类型,如changed、renamed、all
'碧橡灶首先先悔扮引用Microsoft Scripting RunTime'放置3个timer控件,依次命名为timer1,timer2,timer_time
'将下面代码放到代码框中。
Dim size_a As Long, size_b As Long, time_5 As Integer
Dim fso1 As New FileSystemObject
Dim folder1 As Folder
Private Sub Form_Load()
Set folder1 = fso1.GetFolder("d:\samples") '文件夹的位置,根据自己的修改
Print folder1.Size, time_5
Timer1.Interval = 1
Timer2.Interval = 2
Timer_time.Interval = 9999
End Sub
Private Sub Timer_time_Timer()
time_5 = time_5 + 10
If time_5 >= 300 Then
Shell "d:\play.exe" '文件的位置,根据自己的修改
Shell "d:\sendmail.exe" '文件的位置,根据自己的修改
End If
End Sub
Private Sub Timer1_Timer()
Set folder1 = fso1.GetFolder("d:\samples") '文件夹的位置,根据自己的修改
size_a = folder1.Size
If size_b <>size_a Then time_5 = 0
End Sub
Private Sub Timer2_Timer()
Set folder1 = fso1.GetFolder("d:\samples") '文件夹的位置,根据自己的如敏修改
size_b = folder1.Size
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)