Click here to Skip to main content
12,507,862 members (52,275 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
How to get IP address of client machine in ASP.NET?

[edit(zorgoz): case corrected]
Posted 4-Jan-13 1:05am
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!
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Use the following :-

HttpRequest currentRequest = HttpContext.Current.Request;
String    clientIP = currentRequest.ServerVariables["REMOTE_ADDR"];
  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

What have you tried? I suppose nothing :(
How to get client IP in asp.net(C#).[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Request.UserHostAddress gives you the client's IP address
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Hi,

Here is your answer :

find ip address of client's computer[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

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.
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160927.1 | Last Updated 4 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100