
08-05-2004, 11:05 AM
|
Pontificator
Join Date: Aug 2006
Posts: 1,177
|
|
Are You Connected?
Designing applications that are automatically aware of whether or not a network connection exists becomes increasingly interesting. Today's devices can connect using cellular networks, WiFi networks and even passing through the connection held by a desktop PC. Synchronization is one scenario where an application's ability to make intelligent and automatic decisions based on connectivity is useful.
MSDN authors Dan Fox and Jon Box just got their latest contribution "Testing for and Responding to Network Connections in the .NET Compact Framework" published. Take a look at their sample code to learn how to detect network connections from your Microsoft� .NET Compact Framework-based applications.
|
|
|
|
|

08-05-2004, 01:37 PM
|
Oracle
Join Date: Mar 2005
Posts: 980
|
|
I wonder if instead of using 127.0.0.1 you use the IP of a well known web site, is that going to tell you if you are connectted to Internet?
I guess I'll have to test it by myself 
Another trick could be to use the AS IP and that should tell you if you are connected via AS :?:
|
|
|
|
|

08-05-2004, 01:43 PM
|
Pontificator
Join Date: Aug 2006
Posts: 1,177
|
|
Quote:
Originally Posted by ctitanic
I wonder if instead of using 127.0.0.1 you use the IP of a well known web site, is that going to tell you if you are connectted to Internet?
I guess I'll have to test it by myself
Another trick could be to use the AS IP and that should tell you if you are connected via AS :?:
|
This is what we did here: http://www.businessanyplace.net/?p=code#checkconnect 8)
Andy Sjostrom
|
|
|
|
|

08-05-2004, 01:55 PM
|
Oracle
Join Date: Mar 2005
Posts: 980
|
|
Thanks! Let me translate your code to VB .NET
|
|
|
|
|

08-05-2004, 01:55 PM
|
Theorist
Join Date: Dec 2006
Posts: 276
|
|
Thanks for both links! They will come in handy really soon!
|
|
|
|
|

08-05-2004, 03:02 PM
|
Neophyte
Join Date: May 2004
Posts: 4
|
|
Better to use ping
Yes, having a lot of experience of this problem it is much better to check by doing a PING to a local address or gateway etc. The technique used in the article requires the device's TCP/IP and DHCP implementations to be reliable, which of course, is not always the case. If they'd tried this approach on some of the early iPAQ 5450's (pre-SP) then it almost certainly would have been less reliable than a PING.
|
|
|
|
|

08-05-2004, 03:25 PM
|
Theorist
Join Date: Aug 2006
Posts: 298
|
|
Quote:
Originally Posted by Andy Sjostrom
|
I've just recently started picking up C# and have been interested in PPC development. Thanks for the link!
I'm still upset at how boring the UI elements on PPC are, though. Ugly ugly ugly! They remind me of Windows 3.1
Those standard ugly gray buttons. . . I was hoping MS would try and add some visually appealing controls with the new OS. 
|
|
|
|
|

08-05-2004, 03:41 PM
|
Oracle
Join Date: Mar 2005
Posts: 980
|
|
Using OpenNETCF you can change the MS controls for other more appealing.
www.opennetcf.org
|
|
|
|
|
|
|
|