I want to get the ip address whoever is registering in my site. How to do this in ASPNET. I used the following code, but, it is not getting the proper IP Address
string ipaddress = Request.UserHostAddress;
On an Android/tabletGo to your Wifi network settings, then select the network you're connected to. You'll find your IP address along with the other network information.
How Easy Is It to Trace an IP Address? Tracing an unprotected IP address is as simple as a single line in the command prompt. However, if someone has hidden or obscured their IP with a decent VPN service, you'll just receive an error and get no information.
You can use this method to get the IP address of the client machine.
public static String GetIP() { String ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(ip)) { ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } return ip; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With