VB WebBrowser控件对ASP提交表单,VB 对ASP提交表单,VB WebBrowser对ASP提交表单,WebBrowser控件对ASP提交表单,WebBrowser对ASP提交表单,VB WebBrowser 提交表单,VB ASP提交表单,WebBrowser 提交表单,WebBrowser ASP提交表单,VB WebBrowser ASP 提交表单。

VB WebBrowser控件对ASP提交表单:

Private Sub Form_Load()
    WebBrowser1.Navigate "http://219.xxx.xxx.195/Action.asp"
End Sub

Private Sub WebBrowser1_DownloadComplete()
    Dim vDoc, vTag
    Dim i As Integer
    Set vDoc = WebBrowser1.Document
    For i = 0 To vDoc.All.Length - 1                                            '检测所有标签
        If UCase(vDoc.All(i).tagName) = "INPUT" Then                            '找到input标签
            Set vTag = vDoc.All(i)
            If vTag.type = "text" Then                                          '检测类型
                Select Case vTag.Name
                    Case "UserID"                                               '填写用户名的文本框的值
                        vTag.Value = "ddddd"
                End Select
            End If
            If vTag.type = "password" Then                                      '检测密码框类型
                Select Case vTag.Name
                    Case "Password"                                             '密码框的值
                        vTag.Value = "dd"
                End Select
            End If
            If vTag.type = "submit" And vTag.Value = " 登 录 " Then             '登陆按钮
                vTag.Click
            End If
        End If
    Next i
End Sub