Hey. What code would I used to log into a website that uses method="POST" from vb6?
Printable View
Hey. What code would I used to log into a website that uses method="POST" from vb6?
What I've done for an app that gets stock quotes is use the webbrowser control (hidden) to load the login page then enter the username and password using code and then simulate pressing the Login button.
Below is a snipet of my code. HTH :)
VB Code:
Dim SiteURL as String SiteURL = "http://yoursite.com" WB1.Navigate2 "" & SiteURL & "" 'load login screen 'while page is loading do nothing Do While WB1.ReadyState <> READYSTATE_COMPLETE DoEvents Loop 'Now fill in login details WB1.Document.All("username").Value = "" & UserName & "" 'username WB1.Document.All("password").Value = "" & Password & "" 'password WB1.Document.getElementById("Submit").Click 'login button clicked 'while page is loading do nothing Do While WB1.ReadyState <> READYSTATE_COMPLETE DoEvents Loop 'At this point you should now be logged in
Thanks. :) Works well
Glad i could help :wave: