VB WebBrowser 自动登录阿里妈妈 请高手指导
阿菜321 2013-12-25 02:59:48 我是小白,调试半天不成功,望高人指导一二。代码如下:
Private Sub Command2_Click()
WebBrowser1.Document.All("TPL_username_1")(0).Value = "用户名"
WebBrowser1.Document.All("TPL_password_1")(0).Value = "密码"
WebBrowser1.Document.All("J_SubmitStatic").Click ''登陆
End Sub
Private Sub Form_Load()
Command2.Enabled = False
WebBrowser1.Navigate2 "http://www.alimama.com/member/login.htm?spm=0.0.0.0.OA4g9o&forward=http://u.alimama.com"
End Sub
Private Sub Form_Resize()
On Error Resume Next
WebBrowser1.Move 50, WebBrowser1.Top, Me.ScaleWidth - 100, Me.ScaleHeight - WebBrowser1.Top
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If URL <> "about:blank" And URL <> "" And URL <> "http:'/" Then
Command2.Enabled = True
End If
End Sub