title: Getting local host Ip Address
body: <pre><code>public static string GetLocalIpAddress()
      {
          string hostName = Dns.GetHostName();
          IPHostEntry ip = Dns.GetHostEntry(hostName);
          string IpAddress = Convert.ToString(ip.AddressList[2]);
          return IpAddress.ToString();
      }
  </code></pre>
  
  <p>This will some times show Index out of bound exception
  what should be the problem in it.?
  thanks in advance</p>