Predefined IP Address

In this chapter you will learn:

  1. What is the Loopback IP Address
  2. What is the Broadcast IP Address
  3. What is Any IP Address
  4. What is the None IP Address

IPAddress.Loopback

using System;//from  j ava  2s  .co  m
using System.Net;

class MainClass
{
    public static void Main()
    {
        IPAddress test = IPAddress.Loopback;

        Console.WriteLine(test);
    }
}

The code above generates the following result.

IPAddress.Broadcast

using System;//from   j  av  a2 s. c  o  m
using System.Net;

class MainClass
{
    public static void Main()
    {
        IPAddress test = IPAddress.Broadcast;

        Console.WriteLine(test);
    }
}

The code above generates the following result.

IPAddress.Any

using System;//from   j  a v  a 2  s  . c o m
using System.Net;

class MainClass
{
    public static void Main()
    {
        IPAddress test = IPAddress.Any;

        Console.WriteLine(test);
    }
}

The code above generates the following result.

IPAddress.None

using System;//from  j  a v a 2 s. c  o  m
using System.Net;

class MainClass
{
    public static void Main()
    {
        IPAddress test = IPAddress.None;

        Console.WriteLine(test);
    }
}

The code above generates the following result.

Next chapter...

What you will learn in the next chapter:

  1. How to use NetworkCredential to do Web login
  2. Login FTP with Authentication
Home » C# Tutorial » Network
Cookie
CredentialCache
HostEntry
IPHostEntry
IP address from host name
IPEndPoint from IPAddress
IPEndPoint Port
IPEndPoint properties
IPHostEntry
IP Address Parser
Predefined IP Address
NetworkCredential
Ping
Udp Client
Socket connection
Socket creation
Socket sendTo
TcpClient
TcpListener
UdpClient Receive
UdpClient Sending
Uri
WebClient
Response Headers
WebProxy
WebRequest