定时刷网络页面

VERSION 5.00
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
Begin VB.Form frmMain
   BorderStyle     =   1  'Fixed Single
   Caption         =   "我的浏览器"
   ClientHeight    =   10890
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   16065
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   10890
   ScaleWidth      =   16065
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer2
      Left            =   14520
      Top             =   10320
   End
   Begin VB.CommandButton cmdStart
      Caption         =   "开始"
      BeginProperty Font
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   11280
      TabIndex        =   3
      Top             =   10200
      Width           =   1335
   End
   Begin VB.TextBox txtUrl
      BeginProperty Font
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   0
      TabIndex        =   2
      Top             =   10200
      Width           =   10935
   End
   Begin VB.Timer Timer1
      Left            =   1080
      Top             =   6960
   End
   Begin VB.CommandButton cmdExit
      Caption         =   "关闭"
      BeginProperty Font
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   12960
      TabIndex        =   1
      Top             =   10200
      Width           =   1215
   End
   Begin SHDocVwCtl.WebBrowser Web
      Height          =   10095
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   16095
      ExtentX         =   28390
      ExtentY         =   17806
      ViewMode        =   0
      Offline         =   0
      Silent          =   0
      RegisterAsBrowser=   0
      RegisterAsDropTarget=   1
      AutoArrange     =   0   'False
      NoClientEdge    =   0   'False
      AlignLeft       =   0   'False
      NoWebView       =   0   'False
      HideFileNames   =   0   'False
      SingleClick     =   0   'False
      SingleSelection =   0   'False
      NoFolders       =   0   'False
      Transparent     =   0   'False
      ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
      Location        =   ""
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public i As Integer

Private Sub cmdExit_Click()
On Error Resume Next
    End
End Sub

Private Sub cmdStart_Click()
On Error Resume Next
 If Len(Trim(txtUrl.Text)) = 0 Then
    MsgBox "地址为空", vbOKOnly
    Exit Sub
 End If
 Web.Navigate txtUrl.Text
 Timer1.Interval = 10000
 Timer1.Enabled = True
End Sub

Private Sub Form_Load()
On Error Resume Next
'Web.Navigate "http://www.baidu.com"
'Timer1.Interval = 10000
'Timer1.Enabled = True
Call clearCache
Timer2.Interval = 1000
Timer2.Enabled = True
i = 0
End Sub

Private Sub Timer1_Timer()
On Error Resume Next
 Web.Refresh
 'Label1.Caption = "正在清理缓存"

 'Call DelCache("*.*")
 DoEvents
 'Label1.Caption = "清理缓存结束"
End Sub

Private Sub Timer2_Timer()
On Error Resume Next
If i <= 300 Then
  i = i + 1
  Me.Caption = (300 - i) & "秒后清理缓存"
 DoEvents
Else
   i = 0
   'Shell App.Path & "\autoShellCmd.bat", vbHide
   DoEvents
    Call clearCache
   'Call DelCache("*.*")
   DoEvents
   Me.Caption = "清理缓存"
End If

End Sub

Private Sub Web_DownloadBegin()
On Error Resume Next
Web.Silent = True
End Sub

Private Sub Web_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
   pDisp.Document.parentWindow.execScript "window.open=null;"
End Sub

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值