IPEndPoint from IPAddress
In this chapter you will learn:
Create IPEndPoint from IPAddress
using System;/*from j av a2 s .c o m*/
using System.Net;
class MainClass
{
public static void Main()
{
IPAddress test1 = IPAddress.Parse("192.168.1.1");
IPEndPoint ie = new IPEndPoint(test1, 8000);
Console.WriteLine("The IPEndPoint is: {0}", ie.ToString());
Console.WriteLine("The AddressFamily is: {0}", ie.AddressFamily);
Console.WriteLine("The address is: {0}, and the port is: {1}", ie.Address, ie.Port);
}
}
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
Home » C# Tutorial » Network