IPEndPoint sample : IP Address « Network « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Date Time
8.Design Patterns
9.Development Class
10.Event
11.File Stream
12.Generics
13.GUI Windows Form
14.Internationalization I18N
15.Language Basics
16.LINQ
17.Network
18.Office
19.Reflection
20.Regular Expressions
21.Security
22.Services Event
23.Thread
24.Web Services
25.Windows
26.Windows Presentation Foundation
27.XML
28.XML LINQ
C# Book
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Network » IP AddressScreenshots 
IPEndPoint sample
IPEndPoint sample
 

using System;
using System.Net;


public class IPEndPointSample
{
    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}\n",
                ie.Address, ie.Port);

        Console.WriteLine("The min port number is: {0}", IPEndPoint.MinPort);
        Console.WriteLine("The max port number is: {0}\n", IPEndPoint.MaxPort);

        ie.Port = 80;
        Console.WriteLine("The changed IPEndPoint value is: {0}", ie.ToString());

        SocketAddress sa = ie.Serialize();
        Console.WriteLine("The SocketAddress is: {0}", sa.ToString());

    }
}

           
         
  
Related examples in the same category
1.IPAddress AddressFamily
2.Parse an IPAddress
3.Loopback IPAddress
4.Broadcast IPAddress
5.Any IPAddress
6.None IPAddress
7.IsLoopback IPAddress
8.IP Address parse, lookup IP Address parse, lookup
9.Get Host By Name, Get Host Name
10.Get Host Entry
11.Parse Host String
12.Get Current Ip Address
13.Get Host IP Address
w_ww___.___j_a___va2_s_.c___om_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.