Gets or sets the port number of the endpoint in CSharp
Description
The following code shows how to gets or sets the port number of the endpoint.
Example
//from w ww. j a v a2 s . c o m
using System;
using System.Net;
using System.Net.Sockets;
public class Example
{
public static void Main()
{
IPAddress hostIPAddress1 = IPAddress.Parse("127.0.0.1");
IPEndPoint endpoint = new IPEndPoint(hostIPAddress1, 80);
Console.WriteLine(endpoint.Port);
}
}
The code above generates the following result.