Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how to get client side system IP address when hosted to Static IP address of server
Posted

The following will get you the client's IP - System.Web.HttpContext.Current.Request.UserHostAddress.
 
Share this answer
 
Comments
raj ch 21-Oct-11 3:11am    
My vote of 5
Abhinav S 21-Oct-11 3:26am    
Thank you.
Try with this
Request.Params["REMOTE_ADDR"]
 
Share this answer
 
Comments
Uday P.Singh 11-Jul-11 6:11am    
good answer my 5!
Request.ServerVariables["REMOTE_ADDR"]
Try this its working fine so you can easily get client.s IP Address
 
Share this answer
 
v3
Comments
RaisKazi 21-Oct-11 2:56am    
Please use "code"/"pre" tag for Code Block.
You can get client's IP address using following code,
Request.UserHostAddress
 
Share this answer
 
v2
Comments
RaisKazi 21-Oct-11 2:56am    
Please use "code"/"pre" tag for Code Block.
Rajesh Yerramsetti 15-Mar-12 5:42am    
if i am using the above code i am getting the IP:127.0.0.1 but my IP address is 192.168.1.143 where i am going wrong

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