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.
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.NetworkInterfaceInfoAll 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.| Exception | Condition |
|---|---|
| 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. |
For more information about extension methods, see Extension Methods (C# Programming Guide) or How to: Call an Extension Method (Visual Basic).
Show: