各位,小弟需要写一个定时自动刷新的浏览器VB6写,应该如何改呢?我实在不会遍程序啊!
浏览器有以下输入框
发送间隔:输入秒数
起始编号:输入起始数
跳 跃 数:输入跳跃数
最大记录:输入最大记录数按确定BUTTON时,访问
http://localhost/TestRD.php?StartID=起始数
之后自动到了设定的发送间隔时间时就刷新一次
访问地址就要变成了
http://localhost/TestRD.php?StartID=起始数+跳跃数例如
发送间隔:60 秒
起始编号:0
跳 跃 数:15
最大记录:500按确定BUTTON时,访问
http://localhost/TestRD.php?StartID=0
60秒后访问
http://localhost/TestRD.php?StartID=15
再60秒后访问
http://localhost/TestRD.php?StartID=30这样一直下去直到我按STOP或者达到最大记录数(500)
我现在的程序控件命名如下:
发送间隔 Text1
起始编号 Text2
跳 跃 数 Text3
最大记录 Text4
开始按钮 Command1
停止按钮 Command2
时间控件 Timer1
地 址 栏 Combo1
浏览窗口 WebBrowser1
状 态 拦 StatusBar1
进 度 条 ProgressBar1程序代码如下
Option Explicit
Private Sub Command1_Click()
End Sub Private Sub Form_Load()
Me.Caption = "My Internet Explorer"
Combo1.Text = ""
Combo1.Left = 0
WebBrowser1.Top = Combo1.Top + Combo1.Height
WebBrowser1.Left = 0
Form_Resize
StatusBar1.Style = sbrSimple
ProgressBar1.ZOrder
WebBrowser1.Navigate "http://localhost"
End Sub
Private Sub Form_Resize()
On Error GoTo a
Combo1.Width = BtWebBrowser.Width - 100
WebBrowser1.Width = Combo1.Width
WebBrowser1.Height = BtWebBrowser.Height - Combo1.Height - 1000
ProgressBar1.Top = Me.Height - StatusBar1.Height - 330
ProgressBar1.Left = 0.25 * StatusBar1.Width
ProgressBar1.Width = 0.75 * Me.Width - 250
a:
End Sub
Private Sub Combo1_Click()
WebBrowser1.Navigate Combo1.Text
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim i As Long
Dim existed As Boolean
If KeyCode = 13 Then
If Left(Combo1.Text, 7) <> "http://" Then
Combo1.Text = "http://" + Combo1.Text
End If
WebBrowser1.Navigate Combo1.Text
For i = 0 To Combo1.ListCount - 1
If Combo1.List(i) = Combo1.Text Then
existed = True
Exit For
Else
existed = False
End If
Next
If Not existed Then
Combo1.AddItem (Combo1.Text)
End If
End If
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = FalseEnd Sub Private Sub WebBrowser1_DownloadBegin()
StatusBar1.SimpleText = "Now Linking..."
End Sub
Private Sub WebBrowser1_DownloadComplete()
StatusBar1.SimpleText = "Link Finished"
ProgressBar1.Value = 0
End Sub
Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
If ProgressMax = 0 Then Exit Sub
ProgressBar1.Max = ProgressMax
If Progress <> -1 And Progress <= ProgressMax Then
ProgressBar1.Value = Progress
End If
End Sub
Private Sub WebBrowser1_TitleChange(ByVal Text As String)
Combo1.Text = WebBrowser1.LocationURL
End Sub
浏览器有以下输入框
发送间隔:输入秒数
起始编号:输入起始数
跳 跃 数:输入跳跃数
最大记录:输入最大记录数按确定BUTTON时,访问
http://localhost/TestRD.php?StartID=起始数
之后自动到了设定的发送间隔时间时就刷新一次
访问地址就要变成了
http://localhost/TestRD.php?StartID=起始数+跳跃数例如
发送间隔:60 秒
起始编号:0
跳 跃 数:15
最大记录:500按确定BUTTON时,访问
http://localhost/TestRD.php?StartID=0
60秒后访问
http://localhost/TestRD.php?StartID=15
再60秒后访问
http://localhost/TestRD.php?StartID=30这样一直下去直到我按STOP或者达到最大记录数(500)
我现在的程序控件命名如下:
发送间隔 Text1
起始编号 Text2
跳 跃 数 Text3
最大记录 Text4
开始按钮 Command1
停止按钮 Command2
时间控件 Timer1
地 址 栏 Combo1
浏览窗口 WebBrowser1
状 态 拦 StatusBar1
进 度 条 ProgressBar1程序代码如下
Option Explicit
Private Sub Command1_Click()
End Sub Private Sub Form_Load()
Me.Caption = "My Internet Explorer"
Combo1.Text = ""
Combo1.Left = 0
WebBrowser1.Top = Combo1.Top + Combo1.Height
WebBrowser1.Left = 0
Form_Resize
StatusBar1.Style = sbrSimple
ProgressBar1.ZOrder
WebBrowser1.Navigate "http://localhost"
End Sub
Private Sub Form_Resize()
On Error GoTo a
Combo1.Width = BtWebBrowser.Width - 100
WebBrowser1.Width = Combo1.Width
WebBrowser1.Height = BtWebBrowser.Height - Combo1.Height - 1000
ProgressBar1.Top = Me.Height - StatusBar1.Height - 330
ProgressBar1.Left = 0.25 * StatusBar1.Width
ProgressBar1.Width = 0.75 * Me.Width - 250
a:
End Sub
Private Sub Combo1_Click()
WebBrowser1.Navigate Combo1.Text
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim i As Long
Dim existed As Boolean
If KeyCode = 13 Then
If Left(Combo1.Text, 7) <> "http://" Then
Combo1.Text = "http://" + Combo1.Text
End If
WebBrowser1.Navigate Combo1.Text
For i = 0 To Combo1.ListCount - 1
If Combo1.List(i) = Combo1.Text Then
existed = True
Exit For
Else
existed = False
End If
Next
If Not existed Then
Combo1.AddItem (Combo1.Text)
End If
End If
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = FalseEnd Sub Private Sub WebBrowser1_DownloadBegin()
StatusBar1.SimpleText = "Now Linking..."
End Sub
Private Sub WebBrowser1_DownloadComplete()
StatusBar1.SimpleText = "Link Finished"
ProgressBar1.Value = 0
End Sub
Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
If ProgressMax = 0 Then Exit Sub
ProgressBar1.Max = ProgressMax
If Progress <> -1 And Progress <= ProgressMax Then
ProgressBar1.Value = Progress
End If
End Sub
Private Sub WebBrowser1_TitleChange(ByVal Text As String)
Combo1.Text = WebBrowser1.LocationURL
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货