C# IPAddress ScopeId
Description
IPAddress ScopeId
Gets or sets the IPv6 address scope
identifier.
Syntax
IPAddress.ScopeId
has the following syntax.
public long ScopeId { get; set; }
Example
Gets or sets the IPv6 address scope identifier.
using System;//from w w w . ja va2 s. c o m
using System.Net;
using System.Net.Sockets;
public class Example
{
public static void Main()
{
IPAddress address = IPAddress.Parse("127.0.0.1");
if(address.AddressFamily.ToString() == ProtocolFamily.InterNetworkV6.ToString())
Console.WriteLine("Scope Id: " + address.ScopeId.ToString());
}
}