I have a web browser i am working on that auto fills certain elements on a
form on the page... It works perfectly fine with non-SSL sites, but when i
do it on an ssl site it does not...
Here is the code that doesn't work.. what it does is connects to the site,
loads the page up and when the page load is complete, it tries to find the
element on the page get it as an object, then assign a text to the text box
on page then perform the submit button on the page...
Private Sub ButtonItem5_Activate(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ButtonItem5.Activate
cParamUN = "txtUserName="
cParamPW = "txtPassword="
UNValue = "User"
PWValue = "Random3"
AxWebBrowser1.Navigate("https://nav-iis/login.aspx")
AddHandler AxWebBrowser1.NavigateComplete2, AddressOf AutoLoginRSMN
End Sub
Private Sub AutoLoginRSMN(ByVal sender As Object, ByVal e As
AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Even t)
Dim docRSMN As HTMLDocument = New HTMLDocumentClass
docRSMN = Me.AxWebBrowser1.Document
Dim otxtUN As HTMLInputElement = docRSMN.all.item("txtUserName")
Dim otxtPW As HTMLInputElement = docRSMN.all.item("txtPassword")
Dim btnSubmit As HTMLInputButtonElement = docRSMN.all.item("btnLogin")
otxtUN.value = "User"
otxtPW.value = "Random3"
btnSubmit.click()
RemoveHandler AxWebBrowser1.NavigateComplete2, AddressOf AutoLoginRSMN
End Sub
but, the problem is the otxtUN after trying to retrieve the HTMLInputElement
for the item txtUserName or txtPassword never comes back as an object, the
otxtUN and otxtPW are always NOTHING as their values... on the html website
page the input text fields are named txtUserName, txtPassword and btnLogin
for the submit process. what could be wrong? thanks!