IPAddress.AddressFamily プロパティ
アセンブリ: System (system.dll 内)
構文IPv4 の場合は InterNetwork、IPv6 の場合は InterNetworkV6 を返します。
使用例IPAddress クラスのトピックの例を参照してください。
' 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
// 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());
// 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照- IPAddress.AddressFamily プロパティのページへのリンク