Check if IP address is an link local address in CSharp

Description

The following code shows how to check if IP address is an link local address.

Example


using System;//from w ww  . jav  a 2 s .  c o m
using System.Net;
using System.Net.Sockets;

public class Example
{
    public static void Main()
    {
        string ipAddress = "127.0.0.1";

        IPAddress address = IPAddress.Parse(ipAddress);
        Console.WriteLine(address.IsIPv6LinkLocal);

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Network »




IP
Web Client