NetworkInterface Class

NetworkInterface Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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)

No code example is currently available or this language may not be supported.

The NetworkInterface type exposes the following members.

  NameDescription
Public propertyStatic memberNetworkInterfaceTypeGets the type of the network that is servicing Internet requests.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodStatic memberGetInternetInterfaceGets the NetworkInterface object.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (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: 8.1, 8.0, 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.

Show:
© 2017 Microsoft