Results 1 to 4 of 4

Thread: [RESOLVED] Log into a website

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    143

    Resolved [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

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    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:
    1. Dim SiteURL as String
    2.  
    3. SiteURL = "http://yoursite.com"
    4.  
    5. WB1.Navigate2 "" & SiteURL & "" 'load login screen
    6.  
    7. 'while page is loading do nothing
    8. Do While WB1.ReadyState <> READYSTATE_COMPLETE
    9.     DoEvents    
    10. Loop
    11.  
    12. 'Now fill in login details
    13. WB1.Document.All("username").Value = "" & UserName & "" 'username
    14. WB1.Document.All("password").Value = "" & Password & "" 'password
    15.  
    16. WB1.Document.getElementById("Submit").Click 'login button clicked
    17.  
    18. 'while page is loading do nothing
    19. Do While WB1.ReadyState <> READYSTATE_COMPLETE
    20.     DoEvents    
    21. Loop
    22.  
    23.  
    24. 'At this point you should now be logged in

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    143

    Re: Log into a website

    Thanks. Works well

  4. #4
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    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
  •  



Click Here to Expand Forum to Full Width