- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
7#
發表於 2018-4-1 11:38
| 只看該作者
回復 6# msmplay - Option Explicit
- Const 用戶名稱 = "msmplay"
- Const 用戶密碼 = "修改為你的登入密碼"
- Private Sub Ex()
- If 登錄查看 = False Then 登錄
- End Sub
- Private Function 登錄查看() As Boolean
- With CreateObject("InternetExplorer.Application")
- .Navigate "http://forum.twbts.com/task.php?item=done"
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- 登錄查看 = InStr(.Document.BODY.innertext, 用戶名稱)
- .Quit '關閉網頁
- End With
- End Function
- Private Sub 登錄()
- Dim i As Variant, vDoc As Object
- With CreateObject("InternetExplorer.Application")
- ' .Visible = True
- .Navigate "http://forum.twbts.com/logging.php?action=login"
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- Set vDoc = .Document.getElementsByTAGName("INPUT")
- For i = 0 To vDoc.Length - 1
- If vDoc(i).Name = "username" Then vDoc(i).Value = 用戶名稱
- If vDoc(i).Name = "password" Then vDoc(i).Value = 用戶密碼: Exit For
- Next
- Set vDoc = .Document.getElementsByTAGName("input") '.Click
- For i = 0 To vDoc.Length - 1
- If vDoc(i).Type = "checkbox" Then vDoc(i).Click: Exit For
- Next
- Set vDoc = .Document.getElementsByTAGName("button") '.Click
- For i = 0 To vDoc.Length - 1
- If vDoc(i).Name = "loginsubmit" Then vDoc(i).Click: Exit For
- Next
- i = Time
- Do
- DoEvents
- If Time > i + #12:00:30 AM# Then MsgBox .Document.Title & vbLf & " 登入失敗 !": .Quit: End
- Loop Until InStr(.Document.BODY.innertext, 用戶名稱)
- .Quit
- End With
- End Sub
複製代碼 |
|