'vb 6.0 代码:
'所需窗体及控件 Form1,Timer1
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const VK_5 = 53
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
If Format(Now, "HH:MM:SS") = "22:04:00" Then
keybd_event VK_5, 0, 0, 0 ' press 5
keybd_event VK_5, 0, &H2, 0 ' release 5
End Sub
.js脚本:
var t=new Date();if(t.getHours()+""+t.getMinutes()=="2204"){new ActiveXObject("WScript.Shell").SendKeys("5")}