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

帮忙解释一段代码。多谢!

2012-01-21 
帮忙解释一段代码。谢谢!!Sub test()With CreateObject(InternetExplorer.Application).Visible True.n

帮忙解释一段代码。谢谢!!
Sub test()
With CreateObject("InternetExplorer.Application")
  .Visible = True
  .navigate "http://www.sephora.cn/?rsour=baidu&rmeth=brandzone&rterm=title&rcamp=title&_sv_code=36_1938477_134848278|{creative}|{domain}"
  DoEvents
  While .busy
  DoEvents
  Wend
  With .Document
  .GetElementById("username").Value = "hyangyang0613"
  .GetElementById("password").Value = "hyy379509"
  .GetElementById("loginsubmit").Click
  End With
End With
End Sub


[解决办法]

VB code
Sub test()With CreateObject("InternetExplorer.Application") '创建IE对象  .Visible = True                           '可见  .navigate "http://www.sephora.cn/?rsour=baidu&rmeth=brandzone&rterm=title&rcamp=title&_sv_code=36_1938477_134848278|{creative}|{domain}"                        '浏览这个网页       DoEvents                                  '执行这个事件  While .busy                                '反复执行  DoEvents  Wend  With .Document  .GetElementById("username").Value = "hyangyang0613"   '给用户名的文本框的值赋值  .GetElementById("password").Value = "hyy379509"       '密码  .GetElementById("loginsubmit").Click                  '点击登陆按钮  End WithEnd WithEnd Sub 

热点排行