Analyze https page activity

  • Thread starter Thread starter MajorTom
  • Start date Start date
M

MajorTom

Hello group

I have a winforms client application. The customer now wants to have access
to information that is on a web page via https.

We have all the necessary account and password, but the problem is when we
need to confirm some data, the user have to leave his application go to the
web site enter the password and read the result and then confirm the
information.

What I want to do is all the manual steps of getting to the web site and get
the information at run time from the main application.

The main application is a c# winform, I have some classes to get the
response from a http but the page have a button and I don't know how to
analyze what is happening.

Is there a way to analyze what is doing when the user click the bottom from
the web page, and of couse the way to simulate that action from the main
application.

It's obvious that I don't have any experience with http protocol, and sorry
for my English to.

Thanks for your help

MajorTom

PD: I cross posting to 2 different group because I not sure where it's have
to go.
 
In the long run, I think you'll have more consistant success
using the web browser control instead of making http
requests with the WebRequest class in your specific
situation.

Basically, the web browser control will let you
script logging into the web site just as a normal user
would and navigate around the site programmatically
at will.

I say this because a lot of sites with secured logins
will design things in their pages to try and block automated
functionality like you are trying to achieve. There is
nothing they can do that you can script against the
web browser control.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp
 
Thanks for your help

I tried with Webrequest

NetworkCredential networkCredential = new
NetworkCredential("UserName","Password");
networkCredential.Domain = "extranet";

WebRequest myRequest = WebRequest.Create(url);

myRequest.Timeout = 10000;
myRequest.Credentials = networkCredential;

WebResponse myHttpWebResponse = myRequest.GetResponse();


But always get and error (401) unauthorized user.

OK, you tell me, that probably they will try to block automated
functionality

And now I get to the long run

Using the web browser, but I don't have any code or example about how to
scrip for the web browser from c#, can you give me some advice or links to
get started

Thanks again for your help

MajorTom
 
MajorTom said:
Thanks for your help

I tried with Webrequest

NetworkCredential networkCredential = new
NetworkCredential("UserName","Password");
networkCredential.Domain = "extranet";

WebRequest myRequest = WebRequest.Create(url);

myRequest.Timeout = 10000;
myRequest.Credentials = networkCredential;

WebResponse myHttpWebResponse = myRequest.GetResponse();


But always get and error (401) unauthorized user.

OK, you tell me, that probably they will try to block automated
functionality

Are you sure the web site does not use Forms authentication?

Cheers,
 
Are you sure the web site does not use Forms authentication?


Is there a way for me to know?



when I get to the url I receive the normal dialog asking for user name and
password .



I' don't have any experience with webacces, any example any links?



Thanks again



MajorTom
 
MajorTom said:
Is there a way for me to know?

Yes -- if it is Forms authentication, login is done using a normal web
form and the way credentials are exchanged is regular form data, not
authentication headers.

Can you ask the developers of that site what authentication scheme
they're using? Is it a public site or a private site?
when I get to the url I receive the normal dialog asking for user
name and password .

If dialog means browser dialog (not web form) then it is HTTP
challenge/response authentication.
I' don't have any experience with webacces, any example any links?

Try to get hold of a good HTTP reference book, like "HTTP -- The
Definite Guide" from O'Reilly.

Cheers,
 
Back
Top