I am trying to login to a web site using Winsock but i am not able to get any response from the site
this is the code i am using to login
but i don't get anything in Winsock1_DataArrival it just do nothing after successfully login to siteCode:Private Sub cmdLogin_Click() Call DisableAll lblStatus.Caption = "Logging In..." Winsock1.RemoteHost = "test.authorize.net" Winsock1.RemotePort = 443 Winsock1.Connect End Sub Private Sub Form_Initialize() InitCommonControls End Sub Private Sub Winsock1_Connect() PostData = "MerchantLogin=Test&Password=Test" Winsock1.SendData "POST" & " /ui/themes/anet/Logon.aspx?sub=signin HTTP/1.1" & vbCrLf & _ "Host: test.authorize.net" & vbCrLf & _ "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13" & vbCrLf & _ "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" & vbCrLf & _ "Accept-Language: en-us,en;q=0.5" & vbCrLf & _ "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" & vbCrLf & _ "Accept - Encoding: gzip , deflate" & vbCrLf & _ "Keep-Alive: 300" & vbCrLf & _ "Connection: keep-alive" & vbCrLf & _ "Referer: https://test.authorize.net/ui/themes/anet/Logon.aspx?sub=signinMerchantLogin=Test&Password=Test" & vbCrLf & _ "Content-type: application/x-www-form-urlencoded" & vbCrLf & _ "Content-Type: application/x-www-form-urlencoded" & vbCrLf & _ "Content-Length: " & Len(PostData) PageSource = vbNullString End Sub
i have also tested on other login site it work fine
this is the info i get from Firefox Addon
can anybody tell me how can i login using this info?Code:https://test.authorize.net/ui/themes/anet/Logon.aspx?sub=signin POST /ui/themes/anet/Logon.aspx?sub=signin HTTP/1.1 Host: test.authorize.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: https://test.authorize.net/ui/themes/anet/logon.aspx Cookie: stoken=_QoCnESBalNW6cHDwUT%24BB8bcTmvtOcHMY%24b9%24aAcGQA; rwizard=6 Content-Type: application/x-www-form-urlencoded Content-Length: 32 MerchantLogin=Test&Password=Test HTTP/1.x 200 OK Server: Microsoft-IIS/5.0 Date: Wed, 02 Apr 2008 13:54:17 GMT X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 8813




Reply With Quote