Question

I am working on a program which will be used on mobile devices (Full Windows install) that may have 3G connectivity. If the particular device does have 3G connectivity, we would like to take advantage of it. However, the program should be able to prioritize communication based on what type of connection and speed are currently available.

I am able to get a list of the network interfaces using System.Net.NetworkInformation.NetworkInterface, but is there any good way to see if the interface is cell data, wireless, or regular ethernet as well as the available speed (particularly in the case of cell data)?

Was it helpful?

Solution

This will list all of the network connections that are currently up. It should be a place to start.

var interfaces = NetworkInterface.GetAllNetworkInterfaces()
    .Where(n => n.OperationalStatus == OperationalStatus.Up)
    .Select(n => new { Nic = n, Speed = n.Speed });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top