realbasic-nug
[Top] [All Lists]

Re: Connected To Internet?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Connected To Internet?
From: Aaron Ballman <aaron at realsoftware dot com>
Date: Fri, 30 Sep 2005 08:51:21 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <BF60A6B8 dot 6B92%mauitom at maui dot net> <0f3b6717ccffdd19b873e26dd8070823 at pp dot inet dot fi> <6916EFDA-014D-4A5B-B62D-F03691D2E836 at innernine dot com>
A machine can be on the LAN, but not necessarily reach the internet via LAN. So what would be a good way to test whether a machine is connected 'without' triggering dial-up in that case?

Check System.Network.IsConnected, and if that returns true, you're reasonably sure there's no dial-up. Then make a socket on the fly and try to connect to whatever it is you're after. If it connects, you're good. If it doesn't, you're bad. But beware, making connections can and will trigger personal firewall alerts, so don't do it unless you absolutely have to, or else the user will wonder what you're trying to do behind their back.

~Aaron
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>