小编Jes*_*sse的帖子

经营者突然无法工作

一周前我写了这个脚本,当你登录然后根据一天中的时间问候你时会启动它.今天早上它突然突然说:"无效时间"(如果所有其他elseif选项与时间不匹配,它会这样做).这曾经工作到今天.

这是我的代码:

Set objShell = CreateObject("WScript.Shell")
ctime = Time()
usr = objShell.ExpandEnvironmentStrings("%username%")
if ctime > "06:00:00" and ctime < "12:00:00" then
    objShell.Popup "Good Morning, " & usr, 5, "", 4096
elseif ctime > "12:00:00" and ctime < "18:00:00" then
    objShell.Popup "Good Afternoon, " & usr, 5, "", 4096
elseif ctime > "18:00:00" and ctime < "23:59:59" then
    objShell.Popup "Good evening, " & usr, 5, "", 4096
elseif ctime > "00:00:00" and ctime < "06:00:00" then
    objShell.Popup "Good night, …
Run Code Online (Sandbox Code Playgroud)

vbscript time operators

4
推荐指数
1
解决办法
59
查看次数

标签 统计

operators ×1

time ×1

vbscript ×1