This is an example of how to use winsock control. The socket gets data from server, where we have
This is an example of "how to use winsock control". The socket gets data from server, where we have java script file, and load it into a
API Declarations
Public Buffer$
Dim gBot As String
Dim bData() As String
Rate This is an example of how to use winsock control. The socket gets data from server, where we have
(1(1 Vote))
Function bot() As String
Dim myVar, iList As ListItem
gBot = Buffer
gBot = Mid(gBot, InStr(gBot, "Array([") + 7)
gBot = Mid(gBot, 1, InStr(gBot, "]);"))
For Each myVar In Split(gBot, "],[")
bData = Split(myVar, ",")
bData(0) = Trim(Replace(bData(0), "'", ""))
Set iList = Form1.ListView1.ListItems.Add(, , bData(0))
Next
End Function
'CREATE 1 LISTVIEW OF FORM, PUT 1 WINSOCK
'CODE FOR FORM
Option Explicit
'creado por d4rk
Private Sub Form_Load()
ListView1.ListItems.Clear
Winsock1.Close
Winsock1.Connect "usuarios.lycos.es", 80
End Sub
Private Sub ListView1_BeforeLabelEdit(Cancel As Integer)
End Sub
Private Sub Winsock1_Close()
Call bot
End Sub
Private Sub Winsock1_Connect()
'No modificar cadena de JS!!
Buffer = Empty
Winsock1.SendData ("GET /d4rksoft/bots.js" & " HTTP/1.1" & vbCrLf _
& "Accept: */*" & vbCrLf & "Accept: text/html" & vbCrLf & "Host: usuarios.lycos.es" & vbCrLf & vbCrLf)
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim dt$
If Winsock1.State = sckConnected Then Winsock1.GetData dt
Buffer = Buffer & dt
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
This is an example of how to use winsock control. The socket gets data from server, where we have Comments
No comments yet — be the first to post one!
Post a Comment