首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

关于验证网页是否载入完毕?解决方案

2012-03-13 
关于验证网页是否载入完毕???Private Sub Command1_Click()WebBrowser1.Navigate https://signup.live.co

关于验证网页是否载入完毕???
Private Sub Command1_Click()
WebBrowser1.Navigate "https://signup.live.com/signup.aspx?ru=http%3a%2f%2fmail.live.com%2f%3frru%3dinbox&wa=wsignin1.0&rpsnv=11&ct=1264506837&rver=6.0.5285.0&wp=MBI&wreply=http:%2F%2Fsn109w.snt109.mail.live.com%2Fdefault.aspx&lc=2052&id=64855&mkt=zh-cn&bk=1264506838&rollrs=12&lic=1"
Dim x
Set x = WebBrowser1.Document.Title
Do Until x = "注册 — Windows Live"
Loop
MsgBox ("网页载入完毕")
End Sub

上面的代码运行后提示

实时错误“91”
对象变量或With块变量未设置

[解决办法]

VB code
Private Sub Command1_Click()WebBrowser1.Navigate "https://signup.live.com/signup.aspx?ru=http%3a%2f%2fmail.live.com%2f%3frru%3dinbox&wa=wsignin1.0&rpsnv=11&ct=1264506837&rver=6.0.5285.0&wp=MBI&wreply=http:%2F%2Fsn109w.snt109.mail.live.com%2Fdefault.aspx&lc=2052&id=64855&mkt=zh-cn&bk=1264506838&rollrs=12&lic=1"End SubPrivate Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)Dim xx = WebBrowser1.Document.TitleDo Until x = "注册 — Windows Live"LoopMsgBox ("网页载入完毕")End Sub 

热点排行