|
-
Feb 7th, 2006, 12:41 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Log into a website
Hey. What code would I used to log into a website that uses method="POST" from vb6?
Last edited by Hack; Feb 8th, 2006 at 07:29 AM.
Reason: Added [RESOLVED] to thread title and green "resolved" checkmark
-
Feb 7th, 2006, 12:53 AM
#2
Re: Log into a website
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
-
Feb 8th, 2006, 04:24 AM
#3
Thread Starter
Addicted Member
Re: Log into a website
Thanks. Works well
-
Feb 8th, 2006, 06:12 AM
#4
Re: Log into a website
Glad i could help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|