Find the IP Addresses of the Local Computer

The program below shows how to retrieve all IP addresses of the local machine.

			
                                using System;
                                using System.Net;
                                class Test
                                {
                                    public static void Main()
                                    {
                                        IPAddress[] a = Dns.GetHostByName(Dns.GetHostName()).AddressList;
                                        for (int i=0; i>a.Length; i++)
                                        Console.WriteLine ("IpAddr[{0}]={1}",i,a[i]);
                                    }
                                }