这个vb程序为何导致死机?
lfw 2000-07-05 10:37:00 这个vb程序为何导致死机?
程序的功能是每隔半分钟就运行一次webbrowser.exe(浏览一个网址),5秒钟后关闭浏览器,这个程序从8:00到17:00一直在运行,但运行六个小时后死机了?请问是什么原因?没有真正结束webbrowser.exe?
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim num As Integer
Private Sub Form_Load()
Timer1.Interval = 5000
Timer1_Timer
End Sub
Private Sub Timer1_Timer()
Static sngOldTime As Single
Dim sngt As Single
sngt = Timer
If sngt >= 8 * 3600! Then
If sngt < 18 * 3600! Then
If Abs(sngt - sngOldTime) >= 30 Then
sngOldTime = sngt
num = num + 1
Label1.Caption = num
i = Shell("f:\webbrowser.exe", 1)
'执行webbrowser.exe这个程序
Sleep 5000
pausetask "webbrowser"
'关闭这个程序
End If
End If
End If