zoukankan      html  css  js  c++  java
  • VBA自动登陆163信箱

     Sub Goto163()
    With CreateObject("InternetExplorer.Application")
    .Visible = True
    .navigate "http://mail.163.com"
    Do Until .Readystate = 4
    DoEvents
    Loop
    .Document.Forms(0).All(9).Value = "myusername"
    .Document.Forms(0).All(13).Value = "mypassword"
    .Document.Forms(0).All(35).Click
    End With
    MsgBox "Ok"
    End Sub

    或者:

    Sub Goto163()
    With CreateObject("InternetExplorer.Application")
    .Visible = True
    .navigate "http://mail.163.com"
    Do Until .Readystate = 4
    DoEvents
    Loop
    .Document.Forms(0).All("username").Value = "myusername"
    .Document.Forms(0).All("password").Value = "mypassword"
    .Document.Forms(0).All("登录邮箱").Click
    End With
    MsgBox "Ok"
    End Sub

    附:

    Sub show163tags()
    Dim i As Byte
    With CreateObject("InternetExplorer.Application")
    .Visible = True
    .navigate "http://mail.163.com"
    Do Until .Readystate = 4
    DoEvents
    Loop
    On Error Resume Next
    For i = 1 To 100
    If Len(.Document.Forms(0).All(i).Name) > 0 Then Debug.Print "i=" & i; "  name=" & .Document.Forms(0).All(i).Name
    Next
    End With
    MsgBox "ok"
    End Sub

    返回:

    i=9  name=username
    i=13  name=password
    i=17  name=selType
    i=24  name=remUser
    i=26  name=secure
    i=35  name=登录邮箱
    i=40  name=登录网盘
    i=62  name=style
    i=63  name=product

  • 相关阅读:
    c#中@的3种作用
    iOS7 各种问题解决
    时钟
    京东APP(部分)-安卓
    博弈取石子
    博弈取牌
    年月日
    猪(恶作剧程序)
    字符统计
    奇偶类约瑟夫
  • 原文地址:https://www.cnblogs.com/fengju/p/6336276.html
Copyright © 2011-2022 走看看