Windows Phone Thoughts - Daily News, Views, Rants and Raves

Check out the hottest Windows Mobile devices at our Expansys store!


Digital Home Thoughts

Loading feed...

Laptop Thoughts

Loading feed...

Android Thoughts

Loading feed...




Go Back   Thoughts Media Forums > WINDOWS PHONE THOUGHTS > Windows Phone Developer

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2004, 11:05 AM
Andy Sjostrom
Pontificator
Join Date: Aug 2006
Posts: 1,177
Default Are You Connected?

http://msdn.microsoft.com/library/d...rkcomponent.asp

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.
 
Reply With Quote
  #2  
Old 08-05-2004, 01:37 PM
ctitanic
Oracle
ctitanic's Avatar
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 :?:
__________________
Ctitanic
http://www.tweaks2k2.com
 
Reply With Quote
  #3  
Old 08-05-2004, 01:43 PM
Andy Sjostrom
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
 
Reply With Quote
  #4  
Old 08-05-2004, 01:55 PM
ctitanic
Oracle
ctitanic's Avatar
Join Date: Mar 2005
Posts: 980

Thanks! Let me translate your code to VB .NET
__________________
Ctitanic
http://www.tweaks2k2.com
 
Reply With Quote
  #5  
Old 08-05-2004, 01:55 PM
manywhere
Theorist
Join Date: Dec 2006
Posts: 276
Send a message via MSN to manywhere

Thanks for both links! They will come in handy really soon!
 
Reply With Quote
  #6  
Old 08-05-2004, 03:02 PM
jimlad
Neophyte
Join Date: May 2004
Posts: 4
Default 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.
 
Reply With Quote
  #7  
Old 08-05-2004, 03:25 PM
sub_tex
Theorist
sub_tex's Avatar
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.
 
Reply With Quote
  #8  
Old 08-05-2004, 03:41 PM
ctitanic
Oracle
ctitanic's Avatar
Join Date: Mar 2005
Posts: 980

Using OpenNETCF you can change the MS controls for other more appealing.

www.opennetcf.org
__________________
Ctitanic
http://www.tweaks2k2.com
 
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:00 PM.