标题几乎说明了一切。我一直在使用设置为半秒刻度的计时器组件,并比较警报详细信息表,我想知道是否有更好的东西我只是没有看到。
'''
For Each r As DataRow In AlarmsFromDataBase.Rows
Dim CurrentTime As DateTime = New DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second)
If (DateTime.Compare(r("DateTimeAlarms"), CurrentTime) = 0) And r("AlarmHandled") <> True Then
r("AlarmHandled") = True
MsgBox("match found")
End If
Next
'''
这当然可以,但是有没有更有效或更优雅的方法呢?