SyntaxBomb - Indie Coders

Languages & Coding => Blitz Code Archives => BlitzPlus Gui => Topic started by: BlitzBot on June 29, 2017, 00:28:39

Title: [bb] is online? by Airilsm [ 1+ years ago ]
Post by: BlitzBot on June 29, 2017, 00:28:39
Title : is online?
Author : Airilsm
Posted : 1+ years ago

Description : My simple way to check user online without annoing 'Network Connection Popup'. May be not working correctlly on network computer ;)

Code :
Code (blitzbasic) Select
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 :


*(Posted 1+ 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?


Pineapple(Posted 1+ 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