Good I'm wanting to get the ip of the machine.
For that I'm doing this code that when I run it from my website and publish it in my local IIS it works and I get my IP from my machine.
IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName());
String IP = Convert.ToString(localIPs[1]);
This is the url of my page that at the moment of calculating you should get the ip of the machine that is doing the test.
but the moment I publish it on an external website, it means that it is entered on the internet.
I see that the IP of the IIS is obtained and not the IP of the user.
I hope you can help me.
/ ****************** Rspta by Luciano Montañez ************************ ****** /
Place this code.
String IP = Request.UserHostAddress;