Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Ruft die Adressfamilie der IP-Adresse ab.
Namespace: System.Net
Assembly: System (in system.dll)
Syntax
'Declaration
Public ReadOnly Property AddressFamily As AddressFamily
'Usage
Dim instance As IPAddress
Dim value As AddressFamily
value = instance.AddressFamily
public AddressFamily AddressFamily { get; }
public:
property AddressFamily AddressFamily {
AddressFamily get ();
}
/** @property */
public AddressFamily get_AddressFamily ()
public function get AddressFamily () : AddressFamily
Eigenschaftenwert
Gibt InterNetwork für IPv4 oder InterNetworkV6 für IPv6 zurück.
Beispiel
Weitere Einzelheiten finden Sie im Beispiel im Thema zur IPAddress-Klasse.
' 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()));
}
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
.NET Compact Framework
Unterstützt in: 2.0