Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Check IPV6 is multicast or site local or link local by using “IPAdress” class in vb and C# .net.

Author: Maliha Atteeq
Download Source Code : 1052_applicationz.zip

In this simple article you will know how we can check that whether IPV6 is multicast or site local or link local by using “IPAddress” class in vb and C #.net.

 IP address:

System.net.IPAddress  class is used to Provides an Internet Protocol (IP) address.

To get family address:

In order to get address family of the object, this class provides us a property named as AddressFamily. The return type of this property is System.Net.Sockets.AddressFamily. It returns the address of the object.

To demonstrate make a new window application. Drag one button on the form and write the following code:

C#:

private void btn_getAddFamily_Click(object sender, EventArgs e)

        {

            System.Net.Sockets.AddressFamily obj;

            obj=ob.AddressFamily;

            MessageBox.Show(Convert.ToString(ob));

        }

VB:

Private Sub btn_getAddFamily_Click(ByVal sender As Object, ByVal e As EventArgs)

    Dim obj As System.Net.Sockets.AddressFamily

    obj = ob.AddressFamily

    MessageBox.Show(Convert.ToString(ob))

End Sub

To check IPV6 link local:

In order to check whether the IPV6 is link local , this class provides us a property named as IPV6LinkLocal. The return type of this property is boolean. If the IPV6 is link local then it returns true otherwise it returns false.

To demonstrate make a new window application. Drag one button on the form and write the following code:

C#:

private void btn_getIPV6_Click_1(object sender, EventArgs e)

        {

            bool temp;

            temp = ob.IsIPv6LinkLocal;

            if (temp == true)

            {

                MessageBox.Show("the ip adress is IPV6 link local");

            }

            else

            {

                MessageBox.Show("the ip adress is not IPV6 link local");

            }

 

        }

VB:

Private Sub btn_getIPV6_Click_1(ByVal sender As Object, ByVal e As EventArgs)

    Dim temp As Boolean

    temp = ob.IsIPv6LinkLocal

    If temp = True Then

        MessageBox.Show("the ip adress is IPV6 link local")

    Else

        MessageBox.Show("the ip adress is not IPV6 link local")

 

    End If

End Sub

To check IPV6 multicast:

In order to check whether the IPV6 is multi cast , this class provides us a property named as IPV6LinkLocal. The return type of this property is boolean. If the IPV6 is multi cast then it returns true otherwise it returns false.

To demonstrate make a new window application. Drag one button on the form and write the following code:

C#:

private void btn_getIPV6MM_Click(object sender, EventArgs e)

        {

            bool temp;

            temp = ob.IsIPv6Multicast;

            if (temp == true)

            {

                MessageBox.Show("the ip adress is IPV6 multicast");

            }

            else

            {

                MessageBox.Show("the ip adress is not IPV6 multicast");

            }

        }

VB:

Private Sub btn_getIPV6MM_Click(ByVal sender As Object, ByVal e As EventArgs)

    Dim temp As Boolean

    temp = ob.IsIPv6Multicast

    If temp = True Then

        MessageBox.Show("the ip adress is IPV6 multicast")

    Else

        MessageBox.Show("the ip adress is not IPV6 multicast")

    End If

End Sub

To check IPV6 site local:

In order to check whether the IPV6 is site local , this class provides us a property named as IPV6LinkLocal. The return type of this property is boolean. If the IPV6 is site local then it returns true otherwise it returns false.

To demonstrate make a new window application. Drag one button on the form and write the following code:

C#:

private void btn_getIPV6SL_Click(object sender, EventArgs e)

        {

            bool temp;

            temp=ob.IsIPv6SiteLocal;

            if (temp == true)

            {

                MessageBox.Show("the ip adress is IPV6 site local");

            }

            else

            {

                MessageBox.Show("the ip adress is not IPV6 site local");

            }

        }

 

VB:

 

 

Private Sub btn_getIPV6SL_Click(ByVal sender As Object, ByVal e As EventArgs)

    Dim temp As Boolean

    temp = ob.IsIPv6SiteLocal

    If temp = True Then

        MessageBox.Show("the ip adress is IPV6 site local")

    Else

        MessageBox.Show("the ip adress is not IPV6 site local")

    End If

End Sub

Now write the following code on FORM LOAD event:

C#:

private void Form1_Load(object sender, EventArgs e)

        {

            this.Text = "DEVASP APPLICATION";

        }

VB:

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)

   Me.Text = "DEVASP APPLICATION"

End Sub

This simple article tells how we can check that whether IPV6 is multicast or site local or link local by using “IPAddress” class in vb and C #.net.

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Get scheme, user information, original string and local path associated with Uri using “Uri” class in vb.net - C# .net.

Disclaimer - Privacy
© 2002-2017 DevASP.net