Export (0) Print
Expand All

NetworkInterface.LoopbackInterfaceIndex Property

Gets the index of the IPv4 loopback interface.

Namespace:  System.Net.NetworkInformation
Assembly:  System (in System.dll)

public static int LoopbackInterfaceIndex { get; }

Property Value

Type: System.Int32
A Int32 that contains the index for the IPv4 loopback interface.

ExceptionCondition
NetworkInformationException

This property is not valid on computers running only Ipv6.

The index of the loopback interface is usually 1, but you cannot rely on this. Use the LoopbackInterfaceIndex property to get the correct value.

A network interface may have different interface indexes for the IPv4 and IPv6 loopback interface. The LoopbackInterfaceIndex property only returns the IPv4 loopback interface.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft