1 Attachment(s)
Check this code out... Its winsock...
Why wont this code let me SEND some data back...
Where would I put some winsock.senddata that can actually send some data back after recieving some...
I have this..both as code and as ZIP file..
'----------------------------------------------------
Private Sub Command1_Click()
DoEvents
Winsock1.Close
Winsock1.LocalPort = 80
Winsock1.Listen
End Sub
Private Sub Command2_Click()
Dim wsh
Set wsh = CreateObject("WScript.Shell")
wsh.run ("iexplore.exe http://127.0.0.1")
End Sub
Private Sub Form_Load()
Winsock1.Close
Winsock1.LocalPort = 80
Winsock1.Listen
End Sub
'************************************
'*********Connect - Recieve *********
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Close
Winsock1.Accept requestID
If Winsock1.State = sckconnect Then
MsgBox "It IS connected in ConnectionRequest", vbSystemModal, "#"
Winsock1.SendData "<body><h1><center>ConReq OK..</center></h1></body>"
ElseWinsock1.SendData "<body><h1><center>ConReq OK..</center></h1></body>"
MsgBox "Its NOT connected in ConnectionRequest", vbSystemModal, "!"
End If
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String
Winsock1.GetData data
MsgBox data, vbSystemModal, "Data Recieved:"
If Winsock1.State = sckconnect Then
MsgBox "It is connected in DataArrival", vbSystemModal, "#"
Winsock1.SendData "<body><h1><center>ConReq OK..</center></h1></body>"
Else
MsgBox "Its NOT connected in DataArrival", vbSystemModal, "!"
End If
Winsock1.Close
End Sub
'----------------------------------------------
1 Attachment(s)
I solved it MYSELF... Man how much work!
So below i post a working code ,but with minor bugs in it...
Like you must DoubleClick a link, and press update in explorer inorder to recieve and send back data to explorer...
But if you fix the part that reads the GET from explorer then
it will be easy to fix this... Hehe