0

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!

timvb
  • 152
  • 1
  • 3
  • 14
  • 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 Answers2

2

...i'd like to implement this feature in JS if possible. Can this be done in JS?

No.

If not how would i do this in ASP.NET?

Using UserHostAddress.

Community
  • 1
  • 1
T.J. Crowder
  • 879,024
  • 165
  • 1,615
  • 1,639
1

HttpContext.Current.Request.UserHostAddress should do the trick, on the server side.

Dave Bish
  • 17,987
  • 6
  • 40
  • 60