1、间隔可以设置成5分钟或者1分钟;
2、可以这样写代码
static ptime1 As Date
static ptime2 As Date
If ptime1 <> Date.Today AndAlso Format(Date.Now, "HH:mm") >= "07:30" AndAlso Format(Date.Now, "HH:mm") <= "07:35" Then
MyTimers("计划1").Enabled = False
'msgbox(123) 发送代码
ptime1 = Date.Today
MyTimers("计划1").Enabled = True
End If
If ptime2 <> Date.Today AndAlso Format(Date.Now, "HH:mm") >= "20:30" AndAlso Format(Date.Now, "HH:mm") <= "20:35" Then
MyTimers("计划1").Enabled = False
'msgbox(123) 发送代码
ptime2 = Date.Today
MyTimers("计划1").Enabled = True
End If