Compartir a través de


IPEndPoint.Address Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the IP address of the endpoint.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)

Syntax

'Declaration
Public Property Address As IPAddress
public IPAddress Address { get; set; }

Property Value

Type: System.Net.IPAddress
IP address of the endpoint.

Examples

The following example displays the Address property of the IPEndPoint specified.


Dim ipAddr2 As IPAddress = IPAddress.IPv6Loopback
Dim port2 As Integer = 80

Dim endpoint2 As IPEndPoint = new IPEndPoint(ipAddr2,port2)

outputBlock.Text &= "IPEndPoint.Address: "
outputBlock.Text &= endpoint2.Address.ToString()
outputBlock.Text &= vbCrLf

outputBlock.Text &= "IPEndPoint.AddressFamily: "
outputBlock.Text &= endpoint2.AddressFamily
outputBlock.Text &= vbCrLf

outputBlock.Text &= "IPEndPoint.Port: "
outputBlock.Text &= endpoint2.Port
outputBlock.Text &= vbCrLf

outputBlock.Text &= "IPEndPoint.ToString(): "
outputBlock.Text &= endpoint2.ToString()
outputBlock.Text &= vbCrLf

IPAddress ipAddr2 = IPAddress.IPv6Loopback;
int port2 = 80;

IPEndPoint endpoint2 = new IPEndPoint(ipAddr2,port2);

outputBlock.Text += "IPEndPoint.Address: ";
outputBlock.Text += endpoint2.Address;
outputBlock.Text += "\n";

outputBlock.Text += "IPEndPoint.AddressFamily: ";
outputBlock.Text += endpoint2.AddressFamily;
outputBlock.Text += "\n";

outputBlock.Text += "IPEndPoint.Port: ";
outputBlock.Text += endpoint2.Port;
outputBlock.Text += "\n";

outputBlock.Text += "IPEndPoint.ToString(): ";
outputBlock.Text += endpoint2.ToString();
outputBlock.Text += "\n";

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.