Vikky
Vikky

Reputation: 764

How to get Lan IP not public IP in asp.net or javascript

My local IP address in 192.168.0.11. How can i get this using ASP.NET or Javascript.

Currently i am using the below which returns my Public IP Address

Dim ip As String = HttpContext.Current.Request.ServerVariables("REMOTE_ADDR")

i googled many times but every method i got returns my Public IP.

Is it possible to get this info using asp.net or javascript.

Upvotes: 0

Views: 102

Answers (1)

Cerbrus
Cerbrus

Reputation: 72857

You can't. Client-side JavaScript doesn't deal with IP's at all, and server-side languages really have no access to local IP's for the simple reason that this data is not being sent to the server.

If you really want to obtain the local IP, you're going to have to get the user to install some kind of software on their PC.

Upvotes: 1

Related Questions