1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

!! Need Help In Login Using HttpWebrequest !!

Discussion in 'Visual Basic .NET' started by Youtube-Toys, Oct 6, 2012.

  1. Youtube-Toys

    Youtube-Toys Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 28, 2012
    Messages:
    102
    Likes Received:
    70
    Gender:
    Male
    Occupation:
    IT Expert
    Location:
    Internet
    Hello Coding Masters,

    I am trying to login into google using HttpWebrequest but still not got success..

    usally i do programming using web browser but they are only single threaded and slow..that's why i decided to code a bot using Httpwebreuest.

    I am struggling with httpwebrequest from 10 days i searchde much more and also learned on howtostartprogramming

    but i cannot able to login into google..

    i foolow everything using fiddler2 and livehttpheaders..

    but no success..

    i also maintain cookies for all sessions using main cookie container as specified on howtostartprogramming..

    can somebody help me here..

    i just need to know how i can login is there any working example?

    Thans in advance
     
  2. adh0c

    adh0c Newbie

    Joined:
    Apr 20, 2012
    Messages:
    11
    Likes Received:
    7
    Programming with the WebBrowser does suck...

    I couldn't find any up-to-date examples online but I do it with 3 requests.
    First, use Fiddler to decode and view the https (have to setup a certificate to read the https; fiddler has help on doing this) response headers. You need to mimic these.

    Step 1 - Request the login page.
    Make sure to parse all the login variables in the login form.
    Some of these variables change so it's important to refresh each time you login. Don't try using the same variables Fiddler is sending when you manually login.

    Step 2 - Submit the form
    If done correctly, you should be returned with 6 cookies if I recall right. Store these in your Cookie Container.

    Step 3 - Request Google's homepage w/your new cookie container.
    You should find your username in the html that indicates you are successfully logged in.

    After Step 3, navigate as normal using your Cookie Container. You will be logged in as long as you keep using you the same cookie container.

    If your new to programming it may take a little tinkering but it's not difficult once you get Fiddler to decode the HTTPS requests.
     
    • Thanks Thanks x 1
  3. Youtube-Toys

    Youtube-Toys Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 28, 2012
    Messages:
    102
    Likes Received:
    70
    Gender:
    Male
    Occupation:
    IT Expert
    Location:
    Internet
    Thanks A Lot for Detailed Instructons