Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27201

Web Page Logon

$
0
0
Ok . I am trying to write some code to logon to a webpage. I have a form with webbrowser1 navigated to the login page.

the script for the input of UserId, Password and Submit inputs is as follows.




XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


User ID <input type="text" id="UserID" name="UserID" tabindex="1" onkeypress="checkEnter(event);" /><br />


Password <input type="password" id="Password" name="Password" tabindex="2" onkeypress="checkEnter(event);" /><br />



<a href="#" onclick='document.forms["LogonForm"].submit()'><img class="mainsp sprite-btn_login" src="https://cdn.webpagename.com/site/assets/images/spacer.gif" title="Login" /></a>



XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


This is the code that i have tried.

'Inputs ID
WebBrowser1.Document.GetElementById("UserID").SetAttribute("Value", UserID) 'XXXXX this causes a nullreferance exception

'Inputs Password
WebBrowser1.Document.GetElementById("Password").SetAttribute("Value", Password)

'Submits information
WebBrowser1.Document.GetElementById("LogonForm").InvokeMember("submit")



Any suggestions would be appreciated.

Viewing all articles
Browse latest Browse all 27201

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>