>I have this to get the IP of the server:
>
>
> ' Return the IP address
> Public Function GetIP() As String
> Dim lcIP As String
> Dim loIPHostEntry As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName)
>
> lcIP = loIPHostEntry.AddressList.GetValue(0).ToString
>
> Return lcIP
> End Function
>
>
>However, as we know it, on a 64 bit environment, this returns ::1 from ASP.NET. While this has never been a factor so far, I was relying on that to recognize the incoming hit from the Web server in a load balancing environment. Anyone knows how to obtain the real IP of the server in ASP.NET?
Rather than "64 bit environment" I think you meant "ipv6 environment". The "::1" value you're getting back is the local loopback address, the ipv6 equivalent of the ipv4 127.0.0.1.
This link should help:
http://stackoverflow.com/questions/151231/how-do-i-get-the-local-network-ip-address-of-a-computer-programmatically-c
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up