这和语言好像没有太大关系吧
ASP可以通过下边代码得到客户端IP
<%
  request.servervariables("remote_addr")
  request.servervariables("remote_host")
%>

解决方案 »

  1.   

    javascript好象不行,PHP肯定可以
      

  2.   

    NN4 (and NN3 I think but I haven't checked the code with it :) allows 
    that by calling into Java:  var localhost = java.net.InetAddress.getLocalHost();
      var hostname = localhost.getHostName();
      var hostIP = localhost.getHostAddress();  alert('You are visiting from host ' + hostname  + ' with ip address ' + hostIP);The only way with IE to use Java is an applet but the above code 
    (transcribed into Java) run in an applet is reported to return
      localhost
    for the hostname respectively
      127.0.0.1
    for the ip address.So all you can do for IE (and Opera and NN6) is to use server side 
    assists meaning a cgi script or php script dynmically returning the 
    REMOTE_ADDR cgi variable. I have set up such an assists at
      http://xxx.com/ipAddress.php
    which returns a statement of the form
      var ipAddress = '123.123.123.123;
    so that a script can then access the variable
      ipAddress
    to read the value e.g.<HTML>
    <HEAD>
    <SCRIPT SRC="http://xxx.com/ipAddress.php">
    </SCRIPT>
    </HEAD>
    <BODY>
    <SCRIPT>
    document.write(ipAddress)
    </SCRIPT>
    </BODY>
    </HTML>
      

  3.   

    但是即便是E章所说的,得出来的IP也是分不出是代理服务器的IP或真实IP呀
    达不到我的目的
      

  4.   

    本机IP,可以用脚本得到,然后传给server端。
      

  5.   

    to Sander():
       怎么用在客户端运行的脚本得到本机的IP,现在问题就在这里了!!
      

  6.   

    if the ActiveX security settings are low enough, you can use "WScript.Shell" object to run "ipconfig" locally and catch the output