| | |
Winsock getdata after post method
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2009
Posts: 7
Reputation:
Solved Threads: 0
Hi,
I have some problem receiving data with GetData after using post method. GetData returns nothing.
I have installed fiddler the ip-sniffer to se what happends. Fiddler seams to receive data without any problem for the request.
Appreciate your help.
Here is the code I use:
I have some problem receiving data with GetData after using post method. GetData returns nothing.
I have installed fiddler the ip-sniffer to se what happends. Fiddler seams to receive data without any problem for the request.
Appreciate your help.
Here is the code I use:
vb Syntax (Toggle Plain Text)
Dim retData As String Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Sub DoSleep() Sleep (1000) End Sub Private Sub Winsock1_SendProgress(ByVal bytesSent As Long, ByVal bytesRemaining As Long) 'Junk code for break point. Dim dong As Long dong = 5 End Sub Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Dim Data As String Winsock1.GetData (Data) retData = retData & Data Dim x As Integer x = 5 End Sub Private Sub Winsock1_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) Winsock1.Close End Sub Private Sub Submit_Click() 'MsgBox (Me.ContentControls(1).Range.Text) retData = Empty Winsock1.Close If Winsock1.State = sckDisconnected Then Winsock1.RemoteHost = "127.0.0.1" 'Winsock1.LocalPort = 8080 'Set to 80 if you don't use ip sniffer. Winsock1.RemotePort = 8888 Winsock1.Connect If Winsock1.State = sckDisconnected Then MsgBox ("Not connected") Else Dim abc As String abc = "test=34" For i = 0 To 5 If Winsock1.State = sckConnected Then Exit For End If DoSleep DoEvents Next 'Winsock1.SendData ("POST /index.php HTTP/1.1") Winsock1.SendData ("POST /index.php HTTP/1.1" & vbCrLf & _ "Host: " & "127.0.0.1" & ":80" & vbCrLf & vbCrLf) '"Content-Length: " & Len(abc) & vbCrLf & _ '"Connection: Keep-Alive" & vbCrLf & _ 'vbCrLf & abc & vbCrLf) For i = 0 To 5 If Len(retData) > 0 Then Exit For End If DoSleep DoEvents Next 'Winsock1.GetData (msg) 'MsgBox (msg) End If End If End Sub
![]() |
Similar Threads
- how do i pass arrays in javascript to php using POST method (JavaScript / DHTML / AJAX)
- C# Winsock (C#)
- how to send data in POST method using javascript (JavaScript / DHTML / AJAX)
- Help me about Http Client Post method (HTML and CSS)
- " ' " and post method : use of replace function ? (ASP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: New some advise on creating the table.
- Next Thread: How to insert the text on a new line?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





