输入代码
Private Sub Timer_Tick(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles TimerTick
xianzaiTime = TimeOfDay
If RadioButtonChecked Then
If DateDiff(MicrosoftVisualBasicDateIntervalSecond xianzaiTime entTime) < Then 用DateDiff函数判断是否到时间了
End If
End If
PowerOff() 关闭计算机
End Sub
好了基本上一个定时关机程序就完成了接下来加一个超级链接吧!当然对于高手来说可是废话但是对于新手来说这也是必备的这个超级链接当然是我们最喜欢的天极网开发频道了
先创建一个Label控件吧把它托到窗体上将text属性设置为天极网开发频道如图
接下来需要输入代码了双击窗体Form
进入Public Class Form事件
代码
Private Declare Function ShellExecute Lib shelldll Alias ShellExecuteA(ByVal hwngnd As Integer ByVal lpOperation As String ByVal lpFile As String ByVal lpParameters As String ByVal lpDirectory As String ByVal nShowCmd As Integer) As Integer
如图
双击刚才添加的label属性text:(天极网开发频道)中输入以下代码
Private Sub Label_Click(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles LabelClick
ShellExecute( open http://devyeskycom CStr() CStr() )
End Sub
End Class
OK全部搞定按F键运行如图所示选择相应选项后点击(关闭计算机启动定时器按钮)就可以了现在程序将按照你所设定的时间而启动关闭计算机选项
图
[] [] [] []