Programatically Logging in ...

B

batham

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
 
J

John Puopolo

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
 
B

batham

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
 
G

Guest

Tel me exactly what you want, a typical scenario and I'll
try to help.
Example:
Login using my Active Directory login
User belongs to group ADMIN
Redirects the user to the admin page??
 
B

batham

My question is, can I write a .Net C# or VB.Net program which will log
to our company
web site with the appropriate parameters and click a few links and
check the report and then check some values in the report and then
email me.

is that possible ?
 
P

Pete Wood

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top