IPEndPoint.MaxPort Campo

Definición

Especifica el valor máximo que puede asignarse a la propiedad Port. El valor MaxPort está establecido en 0x0000FFFF. Este campo es de solo lectura.

public: int MaxPort = 65535;
public const int MaxPort = 65535;
val mutable MaxPort : int
Public Const MaxPort As Integer  = 65535

Valor de campo

Value = 65535

Ejemplos

En el ejemplo siguiente se usa la MaxPort propiedad para imprimir el valor máximo que se puede asignar a la Port propiedad .

IPAddress^ hostIPAddress1 = (Dns::Resolve( hostString1 ))->AddressList[ 0 ];
Console::WriteLine( hostIPAddress1 );
IPEndPoint^ hostIPEndPoint = gcnew IPEndPoint( hostIPAddress1,80 );
Console::WriteLine( "\nIPEndPoint information:{0}", hostIPEndPoint );
Console::WriteLine( "\n\tMaximum allowed Port Address :{0}", IPEndPoint::MaxPort );
Console::WriteLine( "\n\tMinimum allowed Port Address :{0}", (int^)IPEndPoint::MinPort );
Console::WriteLine( "\n\tAddress Family :{0}", hostIPEndPoint->AddressFamily );

IPAddress hostIPAddress1 = (Dns.Resolve(hostString1)).AddressList[0];
Console.WriteLine(hostIPAddress1.ToString());
IPEndPoint hostIPEndPoint = new IPEndPoint(hostIPAddress1,80);
Console.WriteLine("\nIPEndPoint information:" + hostIPEndPoint.ToString());
Console.WriteLine("\n\tMaximum allowed Port Address :" + IPEndPoint.MaxPort);
Console.WriteLine("\n\tMinimum allowed Port Address :" + IPEndPoint.MinPort);
Console.WriteLine("\n\tAddress Family :" + hostIPEndPoint.AddressFamily);
Dim hostIPAddress1 As IPAddress = Dns.Resolve(hostString1).AddressList(0)
Dim hostIPEndPoint As New IPEndPoint(hostIPAddress1, 80)
Console.WriteLine((ControlChars.Cr + "IPEndPoint information:" + hostIPEndPoint.ToString()))
Console.WriteLine((ControlChars.Cr + ControlChars.Tab + "Maximum allowed Port Address :" + IPEndPoint.MaxPort.ToString()))
Console.WriteLine((ControlChars.Cr + ControlChars.Tab + "Minimum allowed Port Address :" + IPEndPoint.MinPort.ToString()))
Console.WriteLine((ControlChars.Cr + ControlChars.Tab + "Address Family :" + hostIPEndPoint.AddressFamily.ToString()))

Se aplica a