automatically logging into a website

Discussion in 'ASP .Net' started by Brian Henry, Apr 29, 2005.

  1. Brian Henry

    Brian Henry Guest

    Is there a way I could enter a username and password in a windows form then
    take that and cause it to open a website up in IE and "post" the information
    to a site so i can cause that site to log in useing this information?
    Brian Henry, Apr 29, 2005
    #1
    1. Advertising

  2. Brian Henry

    Mona Guest

    Hi Brain,

    You can use the Web Browser control for the implementing the required
    functionality.

    Please refer to the following link for more details:

    [How To Host a WebBrowser Control in Visual C# .NET to Post Form Data]
    http://support.microsoft.com/?kbid=313068

    HTH

    Mona[Grapecity]


    "Brian Henry" <> wrote in message
    news:...
    > Is there a way I could enter a username and password in a windows form
    > then take that and cause it to open a website up in IE and "post" the
    > information to a site so i can cause that site to log in useing this
    > information?
    >
    Mona, Apr 29, 2005
    #2
    1. Advertising

  3. Brian Henry

    Brian Henry Guest

    anyway to do it with an external browser though? would be a little bit
    obtrusive to write a web browser host for the control so you had back
    forward etc...

    "Mona" <> wrote in message
    news:%...
    > Hi Brain,
    >
    > You can use the Web Browser control for the implementing the required
    > functionality.
    >
    > Please refer to the following link for more details:
    >
    > [How To Host a WebBrowser Control in Visual C# .NET to Post Form Data]
    > http://support.microsoft.com/?kbid=313068
    >
    > HTH
    >
    > Mona[Grapecity]
    >
    >
    > "Brian Henry" <> wrote in message
    > news:...
    >> Is there a way I could enter a username and password in a windows form
    >> then take that and cause it to open a website up in IE and "post" the
    >> information to a site so i can cause that site to log in useing this
    >> information?
    >>

    >
    >
    Brian Henry, Apr 29, 2005
    #3
  4. "Brian Henry" <> schrieb:
    > Is there a way I could enter a username and password in a windows form
    > then take that and cause it to open a website up in IE and "post" the
    > information to a site so i can cause that site to log in useing this
    > information?


    Below there is a sample on how to do that with a 'WebRequest' object. I
    assume that this will work with a 'POST' request too:

    \\\
    Imports System.IO
    Imports System.Net
    ..
    ..
    ..
    Dim wrq As WebRequest = _
    WebRequest.Create("https://example.org/shop/order.jsp")
    wrq.Credentials = New NetworkCredential("username", "password")
    Dim wrp As WebResponse = wrq.GetResponse()
    Dim sr As New StreamReader(wrp.GetResponseStream())
    MessageBox.Show(sr.ReadToEnd())
    sr.Close()
    wrp.Close()
    ///

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>
    Herfried K. Wagner [MVP], Apr 29, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Antwerp
    Replies:
    0
    Views:
    1,197
    Antwerp
    Feb 15, 2005
  2. MotorcycleIke

    logging into a website on an external server

    MotorcycleIke, Sep 21, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    444
    MotorcycleIke
    Sep 22, 2005
  3. Replies:
    1
    Views:
    443
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    May 15, 2006
  4. dpoehls
    Replies:
    2
    Views:
    473
    Fuzzyman
    Jan 25, 2006
  5. James_Dean
    Replies:
    0
    Views:
    528
    James_Dean
    Jun 27, 2007
Loading...

Share This Page