C#脚本
var IpAddress = <%=Request.UserHostAddress%>

解决方案 »

  1.   

    C#脚本
    var IpAddress = "<%=Request.UserHostAddress%>"
      

  2.   

    VBscript
    var IpAddress = "<%=Request.ServerVariables("REMOTE_HOST")%>"
      

  3.   

    asp中:
    <%@ Language="javaScript"%>
    <%
    var ip = Request.serverVariables("REMOTE_ADDR");
    %>
    var ip="<%=ip%>";
      

  4.   

    try this wayvar WshShell = new ActiveXObject("Wscript.Shell");
    WshShell.Run("ipconfig > dispIp.txt",1, true);
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    a = fso.OpenTextFile("dispIP.txt", 1, false);
    document.write(a.ReadAll());