吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 4536|回复: 1
收起左侧

[其他转载] 判断 WebBrowser是否已经加载网页完毕 VB源码

[复制链接]
温总 发表于 2014-4-18 14:44

1、

Private Sub Form_Load()
WebBrowser1.navigate "http://www.52pojie.cn"

Do
DoEvents

If Not WebBrowser1.Busy And WebBrowser1.LocationURL <> "http://www.52pojie.cn" Then
MsgBox "OK"

Exit Do

End If

Loop

End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, Url As Variant)

If (pDisp Is WebBrowser1.Object) Then
MsgBox WebBrowser1.LocationURL
End If

End Sub


2、

Private Sub WebBrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant)
'获得网页标题
If Not WebBrowser.Busy Then '判断网页是否下载完毕
Dim strTitle As String
strTitle = WebBrowser.Document.DocumentElement.InnerHtml
strTitle = Mid(strTitle, 1, InStr(1, LCase(strTitle), "</title>") - 1)
strTitle = Mid(strTitle, InStr(1, LCase(strTitle), "<title>") + 7)
Me.Caption = strTitle
End If
End Sub


发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

itxmft 发表于 2014-4-18 15:16
表示看不懂  顶个
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-9-22 03:52

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表