Good question...

Discussion in 'ASP .Net' started by Scott Allen, May 18, 2005.

  1. Scott Allen

    Scott Allen Guest

    Hi temp:

    See:
    http://odetocode.com/Articles/162.aspx

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Wed, 18 May 2005 04:29:42 +0200, "temp"
    <> wrote:

    >can i do something like this in C# / VB.NET?
    >
    >========================================================================
    >
    > my $agent = LWP::UserAgent->new (requests_redirectable => ['POST','GET',
    >'HEAD']);
    > $agent->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
    > $agent->cookie_jar(HTTP::Cookies->new(autosave=>1));
    >
    > my $url="http://www.comcom.com/login.asp";
    > my $result = $agent->get($url);
    >
    > %formfields = (status => 1,
    > username => 'myuser',
    > password => 'mypassword');
    >
    > $result = $agent->post($url, \%formfields);
    > my $html = $result->content();
    > if ( $html =~ /password/i) {
    > $errStr .= "Login to $url failed - Customer# $customerID: $";
    > return 0;
    > }
    >
    >
    >========================================================================
    >
    >Tnx.
    >
    >
     
    Scott Allen, May 18, 2005
    #1
    1. Advertising

  2. Scott Allen

    temp Guest

    can i do something like this in C# / VB.NET?

    ========================================================================

    my $agent = LWP::UserAgent->new (requests_redirectable => ['POST','GET',
    'HEAD']);
    $agent->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
    $agent->cookie_jar(HTTP::Cookies->new(autosave=>1));

    my $url="http://www.comcom.com/login.asp";
    my $result = $agent->get($url);

    %formfields = (status => 1,
    username => 'myuser',
    password => 'mypassword');

    $result = $agent->post($url, \%formfields);
    my $html = $result->content();
    if ( $html =~ /password/i) {
    $errStr .= "Login to $url failed - Customer# $customerID: $";
    return 0;
    }


    ========================================================================

    Tnx.
     
    temp, May 18, 2005
    #2
    1. Advertising

  3. Enter the code into a free translator to either language.

    Sccr18

    "temp" wrote:

    > can i do something like this in C# / VB.NET?
    >
    > ========================================================================
    >
    > my $agent = LWP::UserAgent->new (requests_redirectable => ['POST','GET',
    > 'HEAD']);
    > $agent->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
    > $agent->cookie_jar(HTTP::Cookies->new(autosave=>1));
    >
    > my $url="http://www.comcom.com/login.asp";
    > my $result = $agent->get($url);
    >
    > %formfields = (status => 1,
    > username => 'myuser',
    > password => 'mypassword');
    >
    > $result = $agent->post($url, \%formfields);
    > my $html = $result->content();
    > if ( $html =~ /password/i) {
    > $errStr .= "Login to $url failed - Customer# $customerID: $";
    > return 0;
    > }
    >
    >
    > ========================================================================
    >
    > Tnx.
    >
    >
    >
    >
     
    =?Utf-8?B?U2NjcjE4?=, Jun 23, 2005
    #3
    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. sikka noel
    Replies:
    8
    Views:
    427
    Mike Wahler
    Aug 5, 2003
  2. vlsidesign
    Replies:
    26
    Views:
    1,005
    Keith Thompson
    Jan 2, 2007
  3. Cliff  Martin
    Replies:
    1
    Views:
    3,054
    Larry Smith
    Jan 31, 2007
  4. SM
    Replies:
    9
    Views:
    515
  5. Casey Hawthorne
    Replies:
    18
    Views:
    636
    Beej Jorgensen
    Nov 6, 2009
Loading...

Share This Page