VB 自动登录网页,不要用webbrowser控件,登录的是系统默认浏览器。。。

VB 自动登录网页,不要用webbrowser控件,登录的是系统默认浏览器。。。

前一阵在做淘宝网的东东,贴一个用IE登录淘宝网的
Option Explicit

Sub GotoTaoBao(uid As String, pwd As String)

With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "http://auction1.taobao.com/auction/view_personal_sale_item.jhtml?view_type=viewsold"
Do Until .ReadyState = 4
DoEvents
Loop
.Document.Forms(0).All("TPL_username").Value = uid
.Document.Forms(0).All("TPL_password").Value = pwd
.Document.Forms(0).All("Submit").Click
End With

End Sub

Private Sub Command1_Click()
GotoTaoBao "youID", "youPwd"
End Sub

不用CreateObject的话,要引用Microsoft Internet Controls (shdocvw.dll)
然后声明一个InternetExplorer对象...
温馨提示:内容为网友见解,仅供参考
第1个回答  2009-07-11
既然是这样子的话 自己用vbs写个脚本(能自动登录网页) 然后再用vb,shell他就okle
搜狗的一个解决的帖子

参照做就行了

http://it.wenda.sogou.com/question/34709312.html
第2个回答  2009-07-13
将代码复制到FORM窗体中,代码如下:
'请复制下面的
shell ("explorer.exe http://www.baidu.com") ’你可以把百度改成你自己的网站
'请复制上面的
第3个回答  2009-07-11
shell"explorer.exe ""http://网址"""
第4个回答  2009-07-11
webbrowser控件
相似回答