以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  设置时间范围  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=92459)

--  作者:wangjuan
--  发布时间:2016/11/3 21:41:00
--  设置时间范围
Dim d1 As Date = # 8:30:00#
Dim d2 As Date = # 11:30:00#
Dim t As Date
If "t>d2 " Or "t <d1"  Then
messagebox.show("没有上班,无法进行交班!", "信息提示")
End If
这个代码为什么 没用啊?如何设定时间范围啊?

--  作者:有点蓝
--  发布时间:2016/11/3 22:43:00
--  
Dim d1 As Date = # 8:30:00#
Dim d2 As Date = # 11:30:00#
Dim t As Date  = new Date().AddHours(Date.Now.Hour).AddMinutes(Date.Now.Minute).AddSeconds(Date.Now.Second)
If t>d2  Or t <d1  Then
    messagebox.show("没有上班,无法进行交班!", "信息提示")
End If