IPAddress.AddressFamily プロパティとは何? わかりやすく解説 Weblio辞書 (original) (raw)

IP アドレスアドレス ファミリ取得します

名前空間: System.Net
アセンブリ: System (system.dll 内)
構文構文

Visual Basic (宣言)

Public ReadOnly Property AddressFamily As AddressFamily

Visual Basic (使用法)

Dim instance As IPAddress Dim value As AddressFamily

value = instance.AddressFamily

C#

public AddressFamily AddressFamily { get; }

C++

public: property AddressFamily AddressFamily { AddressFamily get (); }

J#

/** @property */ public AddressFamily get_AddressFamily ()

JScript

public function get AddressFamily () : AddressFamily

プロパティ
IPv4場合は InterNetwork、IPv6 の場合は InterNetworkV6 を返します

使用例使用例

IPAddress クラストピックの例を参照してください

Visual Basic

' Display the type of address family supported by the server. If the ' server is IPv6-enabled this value is: InternNetworkV6. If the server ' is also IPv4-enabled there will be an additional value of InterNetwork. Console.WriteLine(("AddressFamily: " + curAdd.AddressFamily.ToString()))

' Display the ScopeId property in case of IPV6 addresses. If curAdd.AddressFamily.ToString() = ProtocolFamily.InterNetworkV6.ToString() Then Console.WriteLine(("Scope Id: " + curAdd.ScopeId.ToString())) End If

C#

// Display the type of address family supported by the server. If the // server is IPv6-enabled this value is: InternNetworkV6. If the server // is also IPv4-enabled there will be an additional value of InterNetwork. Console.WriteLine("AddressFamily: " + curAdd.AddressFamily.ToString());

// Display the ScopeId property in case of IPV6 addresses. if(curAdd.AddressFamily.ToString() == ProtocolFamily.InterNetworkV6.ToString()) Console.WriteLine("Scope Id: " + curAdd.ScopeId.ToString());

J#

// Display the type of address family supported by the server. // If the server is IPv6-enabled this value is:InternNetworkV6. // If the server is also IPv4-enabled there will be an // additional value of InterNetwork. Console.WriteLine(("AddressFamily: " + curAdd.get_AddressFamily().ToString()));

// Display the ScopeId property in case of IPV6 addresses. if (curAdd.get_AddressFamily().ToString().equals( ProtocolFamily.InterNetworkV6.ToString())) { Console.WriteLine(("Scope Id: " +(new Long(curAdd.get_ScopeId())).ToString())); }

プラットフォームプラットフォーム

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォーム中には.NET Framework によってサポートされていないバージョンありますサポートされているバージョンについては、「システム要件」を参照してください

バージョン情報バージョン情報

.NET Framework
サポート対象 : 2.01.11.0
.NET Compact Framework
サポート対象 : 2.0

参照参照

関連項目
IPAddress クラス
IPAddress メンバ
System.Net 名前空間