<OBJECT id=locator classid=CLSID:76A64158-CB41-11D1-8B02-00600806D9B6 VIEWASTEXT></OBJECT>
<OBJECT id=foo classid=CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223></OBJECT>
<SCRIPT language=JScript>
var service = locator.ConnectServer()
var MACAddr
var IPAddr
var DomainAddr
var sDNSName
service.Security_.ImpersonationLevel=3
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration')
</SCRIPT>
<FORM id=formfoo name=formbar action=NICPost.asp method=post>
<INPUT value=00:05:5D:0E:C7:FA name=txtMACAddr>
<INPUT value=58.245.184.191 name=txtIPAddr >
<INPUT value=typ name=txtDNSName >
</FORM>
使用搜狐接口:
使用新浪接口:(我测试过,此方法好像不行。访问网站也不能访问了。)
个人Robert Hashemian写的:
利用ActiveXObject控件,ie浏览器里要开启此控件:
通过搜狐的ip查询接口实现
$(function(){var api = "://pv.sohu.com/cityjson"//前面加上http
//这里api是搜狐IP地址查询接口
$.get(api,function(data){
var script = $('<script type="text/javascript"/>')[0]
script.defer = true
script.text = data
$(script).appendTo("head")
console.log("cid : " + returnCitySN.cid)
console.log("cip : " + returnCitySN.cip)//得到IP
console.log("cname : " + returnCitySN.cname)//得到城市
},"text")
})