Public EntireFile As String
Private Sub Command1_Click()
EntireFile = ""
Winsock1.Connect "www.nats.co.uk", 80
Label1.Caption = "connecting..."
End Sub
Private Sub Winsock1_Close()
'complete
Label1.Caption = "complete"
Winsock1.Close
EntireFile = Mid(EntireFile, InStr(EntireFile, "<html>"))
text1.Text = EntireFile
End Sub
Private Sub Winsock1_Connect()
Label1.Caption = "connected, sending data...."
Winsock1.SendData "GET /operational/pibs/pib1.shtml HTTP/1.1" & vbCrLf & "Host: www.nats.co.uk" & vbCrLf & "Connection: Close" & vbCrLf & vbCrLf
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim NewData As String
Winsock1.GetData NewData
Label1.Caption = "receiving data..."
Debug.Print NewData
EntireFile = EntireFile & NewData
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)
Label1.Caption = Description
Winsock1.Close
End Sub