NetworkInterface.LoopbackInterfaceIndex 屬性

定義

取得 IPv4 回送介面的索引。

public:
 static property int LoopbackInterfaceIndex { int get(); };
public static int LoopbackInterfaceIndex { get; }
[System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
public static int LoopbackInterfaceIndex { get; }
static member LoopbackInterfaceIndex : int
[<System.Runtime.Versioning.UnsupportedOSPlatform("illumos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("solaris")>]
static member LoopbackInterfaceIndex : int
Public Shared ReadOnly Property LoopbackInterfaceIndex As Integer

屬性值

Int32,包含 IPv4 回送介面的索引。

屬性

例外狀況

這個屬性在只執行 Ipv6 的電腦上是無效的。

備註

回送介面的索引通常是 1,但您無法依賴這個。 LoopbackInterfaceIndex使用屬性來取得正確的值。

網路介面可能會有不同的 IPv4 和 IPv6 回送介面的介面索引。 屬性 LoopbackInterfaceIndex 只會傳回 IPv4 回送介面。

適用於

另請參閱