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.

Re: Analyze https page activity by Robbe

Robbe
Fri Jun 17 20:28:46 CDT 2005

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



"MajorTom" <m.pulgarNO@NOverizon.net.do> wrote in message
news:OtkxkA5cFHA.3144@TK2MSFTNGP10.phx.gbl...
> 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.
>
>
>



Re: Analyze https page activity by MajorTom

MajorTom
Fri Jun 17 23:31:45 CDT 2005

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

"Robbe Morris [C# MVP]" <info@eggheadcafe.com> wrote in message
news:uDLCmT6cFHA.2124@TK2MSFTNGP14.phx.gbl...
> 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
>
>
>
> "MajorTom" <m.pulgarNO@NOverizon.net.do> wrote in message
> news:OtkxkA5cFHA.3144@TK2MSFTNGP10.phx.gbl...
>> 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.
>>
>>
>>
>
>



Re: Analyze https page activity by Joerg

Joerg
Sat Jun 18 11:13:06 CDT 2005

MajorTom wrote:

> 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,
--
http://www.joergjooss.de
mailto:news-reply@joergjooss.de

Re: Analyze https page activity by MajorTom

MajorTom
Sat Jun 18 18:34:07 CDT 2005

> 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



"Joerg Jooss" <news-reply@joergjooss.de> wrote in message
news:xn0e3nh5y44j3ny00d@msnews.microsoft.com...
> MajorTom wrote:
>
>> 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,
> --
> http://www.joergjooss.de
> mailto:news-reply@joergjooss.de



Re: Analyze https page activity by Joerg

Joerg
Sun Jun 19 01:21:19 CDT 2005

MajorTom wrote:

> > Are you sure the web site does not use Forms authentication?
>
>
> 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,
--
http://www.joergjooss.de
mailto:news-reply@joergjooss.de