0
找到答案的問題 - 必須使用web.Document.getElementById(「密碼」)值= strOldPasswordVB6權限被拒絕
我有一個假定的VB6應用程序登錄到一個。網站。它曾經在一段時間裏工作過,但沒有多年運行,現在需要更新。我可以從數據庫中獲取用戶名並插入到網站上的用戶名輸入中,但是當我得到密碼時,我得到「權限被拒絕」錯誤。我假設它與密碼字段有關。任何人都有辦法解決這個問題?
這是給我的錯誤的VB6代碼:
MsgBox ("need to enter password") ' This alert is shown to me
frm.Elements("password").Value = strOldPassword ' this line never executes
MsgBox ("password entered") ' this line never executes
在網頁上有關HTML:
<input type="password" tabindex="1" class="input-xlarge" id="password" name="password" autocomplete="off"/>
strOldPassword只是我嘗試登錄的密碼的字符串變量。我將使用Document.GetElementsByName()方法嘗試此操作,並在其更新後進行更新。 –
設置一個ID並嘗試使用'getElementById':http://www.w3schools.com/vbscript/func_getref.asp – danihp
這工作!簡單的解決方案很難得到。 web.Document.getElementById(「password」)。Value = strOldPassword –