编写程序自动登录Gmail

类别:.NET开发 点击:0 评论:0 推荐:

Dim Flag As Boolean

Private Sub form_load()
    On Error Resume Next
    URL = "http://gmail.google.com"
    wb.Navigate URL
End Sub

Private 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
                'List1.AddItem vTag.Name
                Select Case vTag.Name
                    Case "Email"
                        vTag.Value = Text1.Text
                    Case "Passwd"
                        vTag.Value = Text2.Text
                End Select
            ElseIf vTag.Type = "submit" Then
                vTag.Click
            End If
        End If
    Next i
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub wb_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    Flag = True
End Sub

本文地址:http://com.8s8s.com/it/it40965.htm