Private Sub Command1_Click()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "http://192.168.1.3/M0B2/login.aspx"
Do Until .ReadyState = 4
DoEvents
Loop
.Document.All("txtEMPID").Value = "123456"
.Document.All("txtPWD").Value = 123456"
.Document.All("btnLogin").Click
End With
End Sub
參考別人改的一個自動登錄網站的腳本 單獨一個可以正常使用,假如有第二個按鈕會提示第一個賬號沒有退出,測驗后發現 ·手動打開一個新的IE選項卡是可以重復登錄的,目前分析問題是直接訪問這個IP地址·是有了session,請問是否可以設定相關引數為每次點擊都是打開一個新的選項卡?
感謝大家!
uj5u.com熱心網友回復:
如果你想開發瀏覽器相關的東西建議你用BHO技術,如果你是想提取或設定WEB站點的資訊,建議你用AJAX技術,當然在VB里就不能叫AJAX了,應該叫ABAX
uj5u.com熱心網友回復:
試試這樣行不行:
Private Sub Command1_Click()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "http://192.168.1.3/M0B2/login.aspx"
Do Until .ReadyState = 4
DoEvents
Loop
.Document.All("txtEMPID").Value = "123456"
.Document.All("txtPWD").Value = "123456"
.Document.All("btnLogin").Click
End With
End Sub
Private Sub Command2_Click()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "http://192.168.1.3/M0B2/login.aspx"
Do Until .ReadyState = 4
DoEvents
Loop
.Document.All("txtEMPID").Value = "654321"
.Document.All("txtPWD").Value = "654321"
.Document.All("btnLogin").Click
End With
End Sub
uj5u.com熱心網友回復:
我去試試 最近作業比較多 才回來看到 謝謝您
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/28635.html
標籤:VB基礎類
上一篇:excel vba查找問題
