求助:VB写登录PW论坛问题
Dim flag As BooleanPrivate Sub Command1_Click()
Dim vDoc, vTag
Dim i As Integer
If flag = False Then
MsgBox "请稍等。。。"
Exit Sub
End If
Set vDoc = WB.Document
For i = 0 To vDoc.All.length - 1
If UCase(vDoc.All(i).tagName) = "INPUT" Then
Set vTag = vDoc.All(i)
If vTag.Type = "text" Or vTag.Type = "password" Then
Select Case vTag.Name
Case "pwuser"
vTag.Value = Text1.Text
Case "pwpwd"
vTag.Value = Text2.Text
End Select
End If
End If
If UCase(vDoc.All(i).tagName) = "BUTTON" Then
Set vTag = vDoc.All(i)
If vTag.Type = "submit" Then
vTag.Click
End If
End If
Next i
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim URL As String
On Error Resume Next
URL = "http://www.
WB.Navigate URL
flag = False
End Sub
Private Sub wb_DownloadComplete()
flag = True
End Sub
上面的代码当点击了登录按钮之后只能填表不能登录并跳转页面
登录PW论坛.rar
(2.26 KB)