Click here to Skip to main content
15,908,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to get User machine IP in asp.net??
I am trying this code, in which logMachine name is got correctly, but IP is incorrect.
C#
String logMachine = System.Net.Dns.GetHostEntry(Request.UserHostAddress).HostName;
String IP Address = Request. UserHostAddress;
Posted
v2

 
Share this answer
 
v2
Comments
[no name] 11-Feb-13 5:01am    
I am try to all of this links..same erro..
use this
C#
string IP= Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900