×
Namespaces

Variants
Actions
Revision as of 07:19, 23 July 2013 by vineet.jain (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Checking network availability in Windows Phone

From Nokia Developer Wiki
Jump to: navigation, search

This article explains how to check the availability of network connection on Windows Phone.

WP Metro Icon Wifi.png
WP Metro Icon WP8.png
SignpostIcon WP7 70px.png
Article Metadata
Tested withCompatibilityArticle
Created: SeemaB (24 Sep 2011)
Last edited: vineet.jain (23 Jul 2013)

Introduction

Many applications utilize network connection for various purposes like feeds, sending & receiving data to/from server, etc. The following article explains how one can detect if the network connection is available or not.

Network API Information

Example Code to understand the network connection

namespace NetworkTest
{
public partial class MainPage : PhoneApplicationPage
{
public static readonly DependencyProperty NetProperty =
DependencyProperty.Register("NetworkAvailability",
typeof(string),
typeof(MainPage),
new PropertyMetadata(string.Empty));
 
public MainPage()
{
InitializeComponent();
string isNetworkAvail =
NetworkInterface.GetIsNetworkAvailable() ? "on" : "off";
}
}
}
This page was last modified on 23 July 2013, at 07:19.
207 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×