mardi 24 mars 2015

vb.net auto log-in not working inside tabcontrol


Vote count:

0




vb.net project to auto-log in and manipulate multiple web pages at once. One particular page I was trying to load up, it was for webbrowser named wb3 docked within tabcontrol tabpage3. When I moved it to tabcontrol1 tabpage0 / wb0 it worked fine, but at the third spot it doesn't work. I checked all the settings for wb3 vs wb 0 and tabpage0 and tabpage3 and they're exactly the same. Even when I wait for everything to load, manually click on the tabpage3 so the website is showing it doesn't work. Any ideas why this is happening? Code:



Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click


wb3.Document.All("netid").SetAttribute("value", "MyName")
wb3.Document.All("pass").SetAttribute("value", "MyPassword")

Dim theElementCollection As HtmlElementCollection = wb3.Document.GetElementsByTagName("input")
For Each curElement As HtmlElement In theElementCollection
Dim controlname As String = curElement.GetAttribute("value").ToString
If controlname = "Login" Then
curElement.InvokeMember("click")

End If
Next



End Sub


P.S. The error I get is "Specified cast is not valid"



asked 1 min ago







vb.net auto log-in not working inside tabcontrol

Aucun commentaire:

Enregistrer un commentaire