How to get an IP address in C# code
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1069103">How to get my own IP address in C#?</a>  </p>
</blockquote>



<p>I need to get the IP address of the system, where the application is running by C# code</p>

<pre><code>IPAddress[] ip = Dns.GetHostAddresses(Dns.GetHostName());   
foreach (IPAddress theaddress in ip)
{
    String _ipAddress = theaddress.ToString();
}
</code></pre>

<p>I am using this code, but this is giving a different result in a different operating system. For example, in Windows 7 it is giving "fe80::e3:148d:6e5b:bcaa%14"<br>
and Windows XP it is giving "192.168.10.93".</p>
