0 out of 1 rated this helpful - Rate this topic

NetworkInterface Class

Windows Phone

March 22, 2012

Provides configuration information for a network interface.

System.Object
  System.Net.NetworkInformation.NetworkInterface
    Microsoft.Phone.Net.NetworkInformation.NetworkInterface

Namespace:  Microsoft.Phone.Net.NetworkInformation
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
public sealed class NetworkInterface : NetworkInterface

The NetworkInterface type exposes the following members.

  Name Description
Public property Static member NetworkInterfaceType Gets the type of the network that is servicing Internet requests.
Top
  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method Static member GetInternetInterface Gets the NetworkInterface object.
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)
Top

In general, the developer of a mobile application doesn’t care how the application’s interaction with the Internet is routed—that is, whether it goes over the cellular connection or a connection to a local Wi-Fi hotspot. However, for some applications the type of connection matters. Examples are applications that can offer an enhanced experience over a high-bandwidth Wi-Fi connection or those that want to take care not to overuse a broadband mobile network.

The NetworkInterfaceType property of this class can provide an application with the current connection type.

Applications can be notified when network changes occur on the device—for example, when the Wi-Fi or mobile broadband network goes up or down. The application must register for the NetworkAddressChanged event of the System.Net.NetworkInformation.NetworkChange class. On receipt of the event, the application can use the NetworkInterfaceType property to determine the current connection state.

Windows Phone OS

Supported in: 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Did you find this helpful?
(1500 characters remaining)