这和语言好像没有太大关系吧
ASP可以通过下边代码得到客户端IP
<%
request.servervariables("remote_addr")
request.servervariables("remote_host")
%>
ASP可以通过下边代码得到客户端IP
<%
request.servervariables("remote_addr")
request.servervariables("remote_host")
%>
解决方案 »
- 高分求助,淘宝试衣间实现方式?
- Ext中initialPassField是什么意思?这该怎么理解呢?
- 对象值 赋值问题
- 关于打开子页面验证后返回父页面刷新问题
- 只用html+javascript能进行权限的控制吗?
- 在php中获取js克隆表的数据
- 如何已另一种方式传值到下一页面???
- 问一个JavaScript的语法问题?
- 我用servlet 连接oracle数据库插入数据或者修改数据或者删除数据均如下报错: SQL 字符串不是查询
- 一个关于节点遍历的问题
- 定义int i; 提示缺少;
- 非常急:如何控制图片再网页上自由旋转如顺时针45度,90度等。我们部门几个同事都说在网页上不能实现。我想可能用java脚本能完成,可是具
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>
达不到我的目的
怎么用在客户端运行的脚本得到本机的IP,现在问题就在这里了!!