GetCurrentNetworkInterface Method
Collapse the table of content
Expand the table of content

SocketExtensions.GetCurrentNetworkInterface Method

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

Gets all available information about the network interface.

Namespace:  Microsoft.Phone.Net.NetworkInformation
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

'Declaration
<ExtensionAttribute> _
Public Shared Function GetCurrentNetworkInterface ( _
	socket As Socket _
) As NetworkInterfaceInfo

Parameters

socket
Type: System.Net.Sockets.Socket
The network interface for which to get the information.

Return Value

Type: Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceInfo
All available information about the network interface. Use the InterfaceType and InterfaceSubtype properties to determine the network interface technology.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter.

ExceptionCondition
ArgumentNullException

socket is Nothing.

NetworkException

socket is not bound.

NetworkException

Unable to get the session handle for socket.

NetworkException

socket is not connected.

NetworkException

Unable to get the information for socket.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft