NetTalk Central

Author Topic: Problem loggin in an aspx page (2)  (Read 16246 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Problem loggin in an aspx page (2)
« on: April 30, 2011, 04:37:13 AM »
Sory but I cant see anything in the last topic.
Bruce, may you please attach an image of the Fields tab and the Post tab using xFiles?
I nee to know which fields the wheather example can read with xfiles.
Thanks!

PD: I remeber you the page in case you cant open the last topic...

https://inversor.bullmarket.com.ar/
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem loggin in an aspx page (2)
« Reply #1 on: May 02, 2011, 05:06:15 AM »
attached. Obviously I didn't use the genuine login and password....

[attachment deleted by admin]

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Problem loggin in an aspx page (2)
« Reply #2 on: May 02, 2011, 10:33:30 AM »
Ok, I´m trying to parse the values myself.
When I code:

ThisClient._FormFields.name = 'whatever'
theres no problem but when I code

ThisClient._FormFields.VALUE= 'whatever'
I get an exception error

How can I add the values to the _Formfields queue?

thanks
Alberto

-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem loggin in an aspx page (2)
« Reply #3 on: May 02, 2011, 10:21:54 PM »
use the SetValue method.

NetWebClient.SetValue  Procedure(String pName,String pValue, Long pFile=0,<String pContentType>,<String pCustomHeader>)
You can set a "normal text value" with a simple
net.SetValue('fieldname','value')

If you set the pFile = true parameter then the value contains the full path to the file on the disk. This then uploads the file as part of the POST - basically the same as what a FILE UPLOAD field on a web page. If you wish to explicitly set the content type of the file then you can do that - and you can also include a custom header to the field if required.

In your case of course you're not uploading a file, so you can use the simple form of SetValue.

Incidentally there's also a GETVALUE method.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Problem loggin in an aspx page (2)
« Reply #4 on: May 03, 2011, 10:05:10 AM »
Ok, now I´m parsing the field values.
They looks like yours obtained by xFiles
But, when it post, the values poested are diffrent from the values readed.
See attached images please.
Thanks
Alberto



[attachment deleted by admin]
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem loggin in an aspx page (2)
« Reply #5 on: May 03, 2011, 09:48:15 PM »
sure, variables in a Post are "escape encoded" - meaning that non-alphanumeric characters are encoded as %xx where xx is the Ascii value of the character, as a hex number. ie
/ becomes %2F, \ becomes %5C and so on.
Oh, and spaces turn into a +
a + turns into %2B

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Problem loggin in an aspx page (2)
« Reply #6 on: May 04, 2011, 02:08:26 AM »
Problem is, I still cant log in !
When I use fiddler and look at the FF POST to log in this variables are not "escape encoded" they are exactly the same as the GET.
I dont know what else to do.
May you please attach the wheather.exe example compiled with xfiles?
Thanks
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem loggin in an aspx page (2)
« Reply #7 on: May 04, 2011, 06:51:16 AM »
attached.


[attachment deleted by admin]

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Problem loggin in an aspx page (2)
« Reply #8 on: May 04, 2011, 07:24:22 AM »
Thanks,
With this exe you cant login to the page.
Once you POST, go to the Responce and you see the same login page.
You are not log in.
More, once you post, you can try to access:
https://inversor.bullmarket.com.ar/cart.aspx
and you will see the table:
<table class=taprg cellpadding=5>
<tr class=tahe align=center><td>Especie</td><td>Ult. Precio</td><td colspan=2>Var. %</td><td>Cant. Compra</td><td>Prec. Compra</td><td>Prec. Venta</td><td>Cant. Venta</td><td>Prec. Cierre</td><td>Prec. Max</td><td>Prec. Min</td><td>Mon. Tot.</td><td>Oper.</td><td>Hora</td></tr></TD>
</tr>   
</table>
without data, only titles
you are not log in
Please Bruce, there must be a way to do it!
Thanks
Alberto
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Problem loggin in an aspx page (2)
« Reply #9 on: May 07, 2011, 05:28:39 AM »
Bruce, please, any idea about this?
The panels I need to parse are ajax, may be this make any difference?
Thanks
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem loggin in an aspx page (2)
« Reply #10 on: May 09, 2011, 02:43:13 AM »
Ok, so when you compare the Post made with the example, and the Post made with say a browser, and you compare the two with Fiddler what difference do you see?

Http 1.0 / Http 1.1 maybe?
Some other header maybe?
Something in the formatting of the text?
The content-type of the post maybe?

Obviously I don't speak spanish, so it's hard to understand the page I'm looking at. But compare using Fiddler, and post the differences here.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Problem loggin in an aspx page (2)
« Reply #11 on: May 09, 2011, 06:50:12 AM »
OK, here they are...

Post from fiddler:

POST https://inversor.bullmarket.com.ar/log.aspx HTTP/1.1
Host: inversor.bullmarket.com.ar
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; es-CL; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: es-cl,es;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: https://inversor.bullmarket.com.ar/log.aspx
Cookie: ASP.NET_SessionId=vsgojmvrz4ctcmrede0ulm55
Content-Type: application/x-www-form-urlencoded
Content-Length: 527

__EVENTTARGET=btin&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUKLTk4MTc5NzMxOA9kFggCAQ9kFgQCBw8PFgIeB1Zpc2libGVoZGQCCg8PFgIeCEltYWdlVXJsBSBlc3BlY2lmaWNvL2ltYWdlbmVzL2luZ3Jlc2FyLmdpZmRkAgMPDxYCHgRUZXh0BR1Ub2RvcyBsb3MgZGVyZWNob3MgcmVzZXJ2YWRvc2RkAgUPDxYCHwIFCTUzNTMtNDQyMGRkAgYPDxYCHwIFCzA5LzA1LzIwMTEgZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFBGJ0aW5F9dQxX2zfnvuxOOp0N4YUDGNvvA%3D%3D&__EVENTVALIDATION=%2FwEWBQL%2Fit3dCwKt79HdCwKm4aT3DgKLlL3HBALUs8w0ke1BNZMU8Jbw4Gmsn9AgJZLpmGw%3D&txus=USER&txpa=PASS&btin.x=54&btin.y=14

Post from the Drive example:

POST / HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: inversor.bullmarket.com.ar
Content-Length: 490
Cookie: ASP.NET_SessionId=kw2cu4ea1alxabmzgr0wkgak;
Proxy-Connection: Keep-Alive

__EVENTTARGET=btin&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUKLTk4MTc5NzMxOA9kFggCAQ9kFgQCBw8PFgIeB1Zpc2libGVoZGQCCg8PFgIeCEltYWdlVXJsBSBlc3BlY2lmaWNvL2ltYWdlbmVzL2luZ3Jlc2FyLmdpZmRkAgMPDxYCHgRUZXh0BR1Ub2RvcyBsb3MgZGVyZWNob3MgcmVzZXJ2YWRvc2RkAgUPDxYCHwIFCTUzNTMtNDQyMGRkAgYPDxYCHwIFCzA5LzA1LzIwMTEgZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFBGJ0aW5F9dQxX2zfnvuxOOp0N4YUDGNvvA%3D%3D&__EVENTVALIDATION=%2FwEWBQL%2Fit3dCwKt79HdCwKm4aT3DgKLlL3HBALUs8w0ke1BNZMU8Jbw4Gmsn9AgJZLpmGw%3D&txus=USER&txpa=PASS&btin.x=54&btin.y=14

Thanks again,
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem loggin in an aspx page (2)
« Reply #12 on: May 09, 2011, 09:01:52 PM »
So, there are 2 immediate differences that spring to view.

The first is the HTTP 1.0 vs HTTP 1.1
I don't think that'll make a huge difference - but anything is possible.
netwebclient._HTTPVersion = '1.1'

But the most interesting difference is the "content length".
In one it's 527, in the other it's 490.
Do you have any explanation for the difference?
If you count the characters in the Post String, then which one is right?

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Problem loggin in an aspx page (2)
« Reply #13 on: May 10, 2011, 04:06:13 AM »
Bruce,

If I use netwebclient._HTTPVersion = '1.1' I get the following error:

HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Tue, 10 May 2011 11:32:06 GMT
Connection: close
Content-Length: 311

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>

The problem with the "content length" is with the class, when you press POST in the drive example, the Post String is cutted to 490 chars, look at the attached image. The last char (7) is the first char of the USER string.

I´m trying to use the DEMO example to post, but I still cant login. Will be back to you tomorrow.



[attachment deleted by admin]
-----------
Regards
Alberto