VB设置时间运行

来源:百度知道 编辑:UC知道 时间:2024/06/01 11:32:17
各位高手帮帮忙
我想弄一个..
假如到 星期一的10点钟20分 这个时间,
运行另外一个程序.
这该怎么办..可以详细点吗

Private Sub Form_Load()
Timer1.Interval = 60000 '设置检测时间为1分钟
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Dim XX As Integer, AA As Integer, BB As Integer
XX = Weekday(Now)
AA = Hour(Now)
BB = Minute(Now)
If XX = 2 And AA = 10 And BB = 20 Then
'运行另外一个程序
End If
End Sub

用时间控件一直在判断了.每分钟进行一次判断.

get the time and check if the time in your favour
then shell a winapi function to display

这用什么VB编程啊,直接用系统自带的任务计划还好呢