I have to retrieve internal ip addresses(10.X.X.X) from clients on a intranet. The intranet is built using ASP.NET C# however i'd like to implement this feature in JS if possible. Can this be done in JS? If not how would i do this in ASP.NET? Thanks in advance!
Asked
Active
Viewed 655 times
0
-
Possible duplicated question, http://stackoverflow.com/questions/391979/get-client-ip-using-just-javascript – lmcanavals Mar 12 '12 at 22:37
-
Doesn't look like you can get the internal IP address of the client unless the server is on the same internal network. Here is another duplicate candidate: http://stackoverflow.com/questions/102605/can-i-lookup-the-ip-address-of-a-hostname-from-javascript – Joshua Hayworth Mar 12 '12 at 22:40
-
I cant use PHP or JSON like both solutions suggest. – timvb Mar 12 '12 at 22:52
2 Answers
2
...i'd like to implement this feature in JS if possible. Can this be done in JS?
If not how would i do this in ASP.NET?
Using UserHostAddress
.
![](../../users/profiles/-1.webp)
Community
- 1
- 1
![](../../users/profiles/157247.webp)
T.J. Crowder
- 879,024
- 165
- 1,615
- 1,639
1
HttpContext.Current.Request.UserHostAddress should do the trick, on the server side.
![](../../users/profiles/316300.webp)
Dave Bish
- 17,987
- 6
- 40
- 60