Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 10 UWP - detect if the current internet connection is Wifi or Cellular?

Tags:

In Windows 10 UWP app how do I detect if the current internet connection is Wifi or Cellular?

like image 864
Slakbal Avatar asked Sep 29 '15 13:09

Slakbal


1 Answers

In UWP you can check network connectivity using the IsWlanConnectionProfile or IsWwanConnectionProfile properties.

An example would be:

var temp = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile();

if (temp.IsWlanConnectionProfile)
{
     // its wireless
}else if (temp.IsWwanConnectionProfile)
{
     // its mobile
}

I hope this helps.

like image 80
davemsdevsa Avatar answered Sep 19 '22 05:09

davemsdevsa