Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

How can I check that there is internet connection?


Best Answer Valkyrie-MT, 10 May 2014 - 02:55 AM

A web request to google should usually work, unless the device is in a country that might block it.  For Microsoft Windows, they periodically do a simple web request as well.  It is described here: 

 

http://blog.superuse...work-awareness/

 

 

Go to the full post


  • Please log in to reply
1 reply to this topic

#1 boiacchi

boiacchi

    Member

  • Members
  • PipPip
  • 29 posts
  • LocationLondon

Posted 08 May 2014 - 10:23 PM

Hi,

 

how can I check from the Netduino plus that there is an internet connection available?

 

At the moment I'm using the below code

 

  var request = (HttpWebRequest) WebRequest.Create("http://www.google.co.uk");
                    response = (HttpWebResponse) request.GetResponse();
                    if (response.StatusCode == HttpStatusCode.OK)
                    {
                        
                             //there is internet
                    }

 



#2 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 10 May 2014 - 02:55 AM   Best Answer

A web request to google should usually work, unless the device is in a country that might block it.  For Microsoft Windows, they periodically do a simple web request as well.  It is described here: 

 

http://blog.superuse...work-awareness/

 

 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.