InternetCheckConnection()

BlitzPlus Forums/BlitzPlus Programming/InternetCheckConnection()

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Try this...

[Code]
WebPage$="www.blitzbasic.com"
Net=Web_Connection_Available(WebPage$)
If Net=True
Print "Connection Available"
Else
Print "Not available"
EndIf
WaitKey()
End

; **********************************************

Function Web_Connection_Available(WebPage$)
; Checks to see if an Internet Connection is currently available.
; Returns True if available, otherwise false. Valid web address required.
;
tcp=OpenTCPStream( WebPage$,80 )
CloseTCPStream tcp
If tcp
Return True
Else
Return False
EndIf
End Function
[/Code]

Adjust tcp timeouts if required.