Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim num As Integer
Dim Second, Cent, Hour, TimeInterval, Temp, RefreshNum As Integer
Dim NetAddress As String
Private Sub Combo1_Change()
Dim a As VbMsgBoxResult
If Combo1.Text = "" Then
a = MsgBox("输入值为空", vbOKOnly, "提示")
ElseIf Combo1.Text < 1 Then
a = MsgBox("输入值需要大于等于1", vbOKOnly, "提示")
Else
TimeInterval = Int(Combo1.Text) * 60
Temp = TimeInterval
End If
End Sub
Private Sub Command1_Click()
'Dim a As String
NetAddress = InputBox("请输入网址", "提示")
While NetAddress = ""
NetAddress = InputBox("请输入网址", "提示")
Wend
Label7.Caption = NetAddress
WebBrowser1.Navigate NetAddress
End Sub
Private Sub Form_Load()
Inital_Data
End Sub
Private Sub Timer1_Timer()
TimeInterval = TimeInterval - 1
If TimeInterval = 0 Then
WebBrowser1.Navigate NetAddress
RefreshNum = RefreshNum + 1
TimeInterval = Temp
Label9.Caption = RefreshNum
End If
Second = Second + 1
If Second = 60 Then
Second = 0
Cent = Cent + 1
ElseIf Cent = 60 Then
Cent = 0
Hour = Hour + 1
ElseIf Hour = 24 Then
Second = 0
Cent = 0
Hour = 0
End If
Label4.Caption = TimeInterval
Label1.Caption = Hour & ":" & Cent & ":" & Second
End Sub
Private Sub Inital_Data()
RefreshNum = 0
Second = 0
Cent = 0
Hour = 0
num = 0
TimeInterval = 300
Temp = TimeInterval
Label9.Caption = RefreshNum
Combo1.Text = 3
NetAddress = "bbs.pediy.com"
WebBrowser1.Navigate NetAddress
End Sub