本文介绍了嗨...我想从4pm到6pm停止发送电子邮件....在vb中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助我...我的代码在下面......
pls help me on this...my code is in below.........
Private Sub Form_Load()
time1.Text = "1100"
time2.Text = "1700"
End Sub
Private Sub Timer2_Timer()
lblTime.Caption = "Current Time : " & Format(DateTime.Now, "HH:MM:ss")
AM = time1.Text & "00"
PM = time2.Text & "00"
lblactualtime.Caption = Format(DateTime.Now, "HH:MM:ss")
If AM = Format(DateTime.Now, "HHMMss") Then
SendEmail
Else
If PM = Format(DateTime.Now, "HHMMss") Then
SendEmail
End If
End If
End Sub
推荐答案
Dim sTime As DateTime = DateTime.Parse("4:00:00 PM") 'start
Dim eTime As DateTime = DateTime.Parse("6:00:00 AM") 'end
If DateTime.Now.CompareTo(sTime) >= 0 And DateTime.Now.CompareTo(eTime) <= 0 Then
'Do Something
End If
这篇关于嗨...我想从4pm到6pm停止发送电子邮件....在vb中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!