Click here to Skip to main content
15,878,871 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
How to get IP address of client machine in ASP.NET?

[edit(zorgoz): case corrected]
Posted
Updated 4-Jan-13 1:09am
v2
Comments
Zoltán Zörgő 4-Jan-13 7:08am    
Don't be rude, don't use CAPITALS!

Use the following :-

C#
HttpRequest currentRequest = HttpContext.Current.Request;
String    clientIP = currentRequest.ServerVariables["REMOTE_ADDR"];
 
Share this answer
 
v2
What have you tried? I suppose nothing :(
How to get client IP in asp.net(C#).[^]
 
Share this answer
 
Request.UserHostAddress gives you the client's IP address
 
Share this answer
 
Hi,

Here is your answer :

find ip address of client's computer[^]
 
Share this answer
 
Hi,

Here is your answer :

http://www.codeproject.com/Questions/291453/find-ip-address-of-clients-computer

Hope it ll help you,if not please let me know.

Thanks.
 
Share this answer
 
Comments
bjay tiamsic 20-Sep-15 23:18pm    
Hi. The link answer did not work for me. I'm in the network currently. When I type in server47/mywebsitedir/webmainpage/login.aspx

it gives my computer's ip address.

but when I used server47's public ipaddress
(example)
201.12.258.1/mywebsitedir/webmainpage/login.aspx
it gives the server47's ip address (192.1.2.3), not my computer's ip address.

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