Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim atimer As Timer = New Timer()
AddHandler atimer.Elapsed, New ElapsedEventHandler(AddressOf theout)
atimer.Interval = 2000
atimer.AutoReset = True
atimer.Enabled = True
End Sub
Public Sub theout(ByVal source As Object, ByVal e As System.Timers.ElapsedEventArgs)
Dim AutoTask As ArrayList = New ArrayList()
AutoTask.Add("8:30:00")
AutoTask.Add("9:37:00")
AutoTask.Add("10:30:00")
AutoTask.Add("2020/4/7 18:22:00")
For n As Integer = 0 To 4 - 1
If DateTime.Now.ToString().Equals(AutoTask(n)) Then
MessageBox.Show("现在时间是" & AutoTask(n))
End If
Next
End Sub