NetworkInterface Class
March 22, 2012
Provides configuration information for a network interface.
System.Net.NetworkInformation.NetworkInterface
Microsoft.Phone.Net.NetworkInformation.NetworkInterface
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)
The NetworkInterface type exposes the following members.
| Name | Description | |
|---|---|---|
|
NetworkInterfaceType | Gets the type of the network that is servicing Internet requests. |
| Name | Description | |
|---|---|---|
|
Equals | (Inherited from Object.) |
|
Finalize | (Inherited from Object.) |
|
GetHashCode | (Inherited from Object.) |
|
GetInternetInterface | Gets the NetworkInterface object. |
|
GetType | (Inherited from Object.) |
|
MemberwiseClone | (Inherited from Object.) |
|
ToString | (Inherited from Object.) |
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.