For Programmers: Free Programming Magazines  


Home > Archive > Microsoft Webservices > March 2005 > Programatically Logging in ...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Programatically Logging in ...
batham

2005-02-23, 9:00 pm

Hello Gurus,
Can someone direct me to the right path.

Using C# to create a web service, how can I programatically log in a
web site (with a valid username and password) and navigate to a
particular URL in it and check the contents of that page.

Is that possible ? please give few examples ;)

Help is appreciated.

Thanks,
Shailendra Batham

John Puopolo

2005-02-23, 9:00 pm

Hi...

Your program can do anything you can do at the keyboard. In order to log
in, you would need to issue an HTTP request using POST or GET appropriately
and supply the proper parameters. The response from the Web server is to
send you a stream of HTML. Your program could read that block of HTML and
do whatever it wants to... a Web Browser's job is to display it. You could
do whatever.

If the Web site issues a cookie to logged in users, you can fetch the cookie
from the response, store it and send it with subsequent requests.

John Puopolo


"batham" <batham@gmail.com> wrote in message
news:1109199114.946663.264140@l41g2000cwc.googlegroups.com...
> Hello Gurus,
> Can someone direct me to the right path.
>
> Using C# to create a web service, how can I programatically log in a
> web site (with a valid username and password) and navigate to a
> particular URL in it and check the contents of that page.
>
> Is that possible ? please give few examples ;)
>
> Help is appreciated.
>
> Thanks,
> Shailendra Batham
>



batham

2005-02-23, 9:00 pm

Thanks for the reply John.

But could you show me some C# or VB.Net samples, to logging in the web
site with parameters and how to programatically navigate.

Thanks,
Shailendra Batham

batham

2005-02-24, 9:00 pm

Is there anyone out there who had such a problem ? or any idea how to
do this ?

Pete Wood

2005-03-25, 4:00 pm

Hi there...

WS-Security defines a UsernameToken element to provide the means for basic
username/password validation. You can download WSE2.0 from MS to add this
functionality to your application.

<!-- Clear Text Password -->
<UsernameToken>
<Username>Bob</Username>
<Password Type="wsse:PasswordText">Abracadabra</Password>
</UsernameToken>

--
Peter Wood
Visit us at http://www.webserviceshelp.org
______________________________________


"batham" <batham@gmail.com> wrote in message
news:1109284369.720798.178910@z14g2000cwz.googlegroups.com...
> Is there anyone out there who had such a problem ? or any idea how to
> do this ?
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com