Code archives/BlitzPlus Gui/is online?

This code has been declared by its author to be Public Domain code.

Download source code

is online? by Mag
(Posted 21 years ago)
My simple way to check user online without annoing 'Network Connection Popup'. May be not working correctlly on network computer ;)
If OnLine() Print "You're online" Else Print "You're not online"
WaitKey()
End

Function OnLine()
n = CountHostIPs("")
For k=1 To n
ip = HostIP(k)
ipaddress$ = DottedIP$(ip)
If ipaddress$="127.0.0.1"
	notconnect=1
EndIf
Next
Return Not(notconnect)
End Function

Comments

EdzUp[SD]
(Posted 21 years ago)
the only question I have with this, is does it still tell you if you are online on the internet or just connected to a network?

B+man
(Posted 21 years ago)
Yeah, personally, I'd use a function that sends a request to a few servers (microsoft.com, google.com, yahoo.com) if at least one responds, then your online, if not, well, chances are your not! :)

Anyway, that's me, but I'm sure someone will have a use for the above! ;)

Dabz

Code Archives Forum