时间:2021-07-01 10:21:17 帮助过:3人阅读
代码如下:
<script language="JavaScript">
function GetLocalIPAddr(){
var oSetting = null;
var ip = null;
try{
oSetting = new ActiveXObject("rcbdyctl.Setting");
ip = oSetting.GetIPAddress;
alert(ip);
if (ip.length == 0){
return "没有连接到Internet";
}
oSetting = null;
}catch(e){
return ip;
}
return ip;
}
alert(GetLocalIPAddr())
</script>
保存早本地,保存为 getip.htm即可