-3

I am developing a JavaScript application and I need a piece of code that can identify the PC LAN IP because I want to prevent unauthorized user to access my application and main factor is PC is not connected to internet but only connected to static LAN IP so how can I achieve this?

thanks in advance.

Vrushank
  • 131
  • 2
  • 8

1 Answers1

0
function myIP(){ var vi="uses java to get the users local ip number"
    var yip2=java.net.InetAddress.getLocalHost();   
    var yip=yip2.getHostAddress();
  return yip;
}//end myIP

alert("your machine's local network IP is "+ myIP());

Reference : http://www.webdeveloper.com/forum/showthread.php?242538-Getting-local-IP-address-in-javascript

ngrashia
  • 9,869
  • 5
  • 43
  • 58