首先,在VB6的窗体上添加WebBrowser控件(Ms internet control),按钮1,按钮2,然后添加如下代码,即可快速登陆你的163邮箱
Private Sub Command1_Click()
WebBrowser1.Navigate "http://mail.163.com"
End Sub
Private Sub Command2_Click()
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
Set vTag = vDoc.All(i)
If vTag.Type = "text" Or vTag.Type = "password" Then
Select Case LCase(vTag.Name)
Case "username"
vTag.Value = "admin" ’帐户
Case "password"
vTag.Value = "123456" ‘密码
End Select
ElseIf vTag.Type = "submit" Then
vTag.Click
End If
End If
Next i
End Sub
Private Sub Form_Resize()
Me.WebBrowser1.Width = Me.Width - 60
Me.WebBrowser1.Left = 0
Me.WebBrowser1.Height = Me.Height - 500
Me.WebBrowser1.Top = 500
End Sub
Private Sub WebBrowser1_Click()
End Sub