Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21089

Winsock Packet Issue

$
0
0
I'm workin on a program that connects or logs in to a website. The website is on a vbulletin board. I sniffed the packet and put it in my program, but i can't find anything that explains exactly what does what with the login packet. (i do know the basics of it) but i'm obviously not putting the packet together correctly. Here's what i have.

when i run this i get the msgbox error. "Valid name, no data record of requested type"
Can anyone explain to me what i'm doing wrong and how to correct it? ty

Code:

Private Sub cmdLogin_Click()
With WS
    .Close
    .RemoteHost = "http://www.dark-realm.us/"
    .RemotePort = 80
    .Connect
End With
End Sub

Private Sub Form_Unload(Cancel As Integer)
WS.Close
End
End Sub

Private Sub WS_Connect()
Dim strPacket As String, Post As String

    Post = "vb_login_username=" & txtUser.Text & "&vb_login_password=" & txtPass.Text
   
    strPacket = "POST /login.php?do=login HTTP/1.1" & vbCrLf
    strPacket = strPacket & "Host: www.dark-realm.us" & vbCrLf
    strPacket = strPacket & "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:26.0) Gecko/20100101 Firefox/26.0" & vbCrLf
    strPacket = strPacket & "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" & vbCrLf
    strPacket = strPacket & "Accept-Language: en-US,en;q=0.5" & vbCrLf
    strPacket = strPacket & "Connection: close" & vbCrLf
    strPacket = strPacket & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
    strPacket = strPacket & "Content-Length: " & Len(Post) & vbCrLf & vbCrLf & Post
   
If WS.State = 7 Then WS.SendData strPacket
End Sub

Private Sub WS_DataArrival(ByVal bytesTotal As Long)
Dim Data As String

If WS.State = 7 Then
    WS.PeekData Data
    txtData.Text = Data
End If
End Sub

Private Sub WS_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
WS.Close
MsgBox Description
End Sub


Viewing all articles
Browse latest Browse all 21089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>