Skip to content

WP7 Network Connection Check

April 14, 2011

Not everyone can have instant internet network access on the Windows Mobile 7, so here I will give a really quick pointer to how you can code to check network connection, in the namespace there is Microsoft.Phone.Net.NetworkInformation; 

You can then use this namespace, to run the method that checks if a network connection is available via a boolean accessor done via: –

if (NetworkInterface.GetIsNetworkAvailable())

{

    Do some conection stuff or alert here…

}

or alternatively, you can write: -

bool hasNetworkConnection =
NetworkInterface.NetworkInterfaceType != NetworkInterfaceType.None;

It is as simple as that using one linr of code for a bollean check, hope that helps!!

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: