复制代码 代码如下: <BR>function GetLocalIPAddr(){ <BR>var oSetting = null; <BR>var ip = null; <BR>try{ <BR>oSetting = new ActiveXObject("rcbdyctl.Setting"); <BR>ip = oSetting.GetIPAddress; <BR>alert(ip); <BR>if (ip.length == 0){ <BR>return "没有连接到Internet"; <BR>} <BR>oSetting = null; <BR>}catch(e){ <BR>return ip; <BR>} <BR>return ip; <BR>} <BR>alert(GetLocalIPAddr()) <BR> 保存早本地,保存为 getip.htm即可