IPAddress.AddressFamily Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene la familia de direcciones de la dirección IP.
public:
property System::Net::Sockets::AddressFamily AddressFamily { System::Net::Sockets::AddressFamily get(); };
public System.Net.Sockets.AddressFamily AddressFamily { get; }
member this.AddressFamily : System.Net.Sockets.AddressFamily
Public ReadOnly Property AddressFamily As AddressFamily
Valor de propiedad
Devuelve InterNetwork para IPv4 o InterNetworkV6 para IPv6.
Ejemplos
Consulte el ejemplo del tema de la IPAddress clase .
// Display the type of address family supported by the server. If the
// server is IPv6-enabled this value is: InterNetworkV6. If the server
// is also IPv4-enabled there will be an additional value of InterNetwork.
Console::WriteLine( "AddressFamily: {0}", curAdd->AddressFamily );
// Display the ScopeId property in case of IPV6 addresses.
if ( curAdd->AddressFamily.ToString() == ProtocolFamily::InterNetworkV6.ToString() )
Console::WriteLine( "Scope Id: {0}", curAdd->ScopeId );
// Display the type of address family supported by the server. If the
// server is IPv6-enabled this value is: InterNetworkV6. 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: InterNetworkV6. 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
Se aplica a
Colaborar con nosotros en GitHub
El origen de este contenido se puede encontrar en GitHub, donde también puede crear y revisar problemas y solicitudes de incorporación de cambios. Para más información, consulte nuestra guía para colaboradores.