IPInterfaceProperties.GatewayAddresses プロパティ
アセンブリ: System (system.dll 内)

Dim instance As IPInterfaceProperties Dim value As GatewayIPAddressInformationCollection value = instance.GatewayAddresses
public: virtual property GatewayIPAddressInformationCollection^ GatewayAddresses { GatewayIPAddressInformationCollection^ get () abstract; }
ネットワーク ゲートウェイのアドレス情報を格納している IPAddressCollection。ゲートウェイが見つからない場合は空の配列。

ゲートウェイは、ネットワーク間でパケットを転送するためにインターネット プロトコル (IP: Internet Protocol) を実装します。

ローカル コンピュータ上のネットワーク インターフェイスについて、ゲートウェイ アドレスを表示するコード例を次に示します。
Public Shared Sub DisplayGatewayAddresses() Console.WriteLine("Gateways") Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces() Dim adapter As NetworkInterface For Each adapter In adapters Dim adapterProperties As IPInterfaceProperties = adapter.GetIPProperties() Dim addresses As GatewayIPAddressInformationCollection = adapterProperties.GatewayAddresses If addresses.Count > 0 Then Console.WriteLine(adapter.Description) Dim address As GatewayIPAddressInformation For Each address In addresses Console.WriteLine(" Gateway Address ......................... : {0}", address.ToString()) Next address Console.WriteLine() End If Next adapter End Sub 'DisplayGatewayAddresses
public static void DisplayGatewayAddresses() { Console.WriteLine("Gateways"); NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface adapter in adapters) { IPInterfaceProperties adapterProperties = adapter.GetIPProperties(); GatewayIPAddressInformationCollection addresses = adapterProperties.GatewayAddresses; if (addresses.Count >0) { Console.WriteLine(adapter.Description); foreach (GatewayIPAddressInformation address in addresses) { Console.WriteLine(" Gateway Address ......................... : {0}", address.ToString()); } Console.WriteLine(); } } }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からIPInterfaceProperties.GatewayAddresses プロパティを検索する場合は、下記のリンクをクリックしてください。

- IPInterfaceProperties.GatewayAddresses プロパティのページへのリンク