Date: 02-16-2022
Return to Index
created by gbSnippets
'Credit: Drawn mostly from the PowerBASIC sample
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile Exe
#Dim All
%Unicode = 1
#Include "Win32API.inc"
Function PBMain() As Long
Local Buffer$, Site$, File$, Entire_page$
Local Length&
Site$ = "www.garybeene.com"
File$ = "http://www.garybeene.com/files/peter.htm"
Tcp Open "http" At Site$ As #1 TimeOut 60000 'Connecting...
If Err Then Beep : Exit Function 'Could we connect to site?
Tcp Print #1, "GET " & File$ & " HTTP/1.0" 'Send the GET request...
Tcp Print #1, ""
' Retrieve the page...
Do
Tcp Recv #1, 4096, Buffer$
Entire_page = Entire_page + Buffer$
Loop While IsTrue Len(Buffer$) And IsFalse Err
Tcp Close #1 'Close the TCP/IP port...
? Entire_Page
End Function
'gbs_01347
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm