<script type=text/javascript教程 src=http://fwqqcom/ipaddress></script>
<script type=text/javascript>
var hehe=IPData[]
var hehe=IPData[]
alert(hehe);
alert(hehe);
documentwrite(IPDatajoin( ));
</script>
如何用ASP来存储从上面读取出来的数据呢
回答
复制代码 代码如下:
<%
function GetResStr(URLcode)
errclear
dim HttpReturnStr
Set Http=servercreateobject("MicrosoftXMLHTTP")
Httpopen "GET"URLFalse
HttpSend()
If HttpReadystate = Then
If Httpstatus= Then
ReturnStr=BytesToBstr(code)
GetResStr=ReturnStr
End If
End If
End Function
函数名:BytesToBstr
作用:转换二进制数据为字符
参数:Body二进制数据Cset文本编码方式
Function BytesToBstr(BodyCset)
Dim Objstream
Set Objstream = ServerCreateObject("adodbstream")
objstreamType =
objstreamMode =
objstreamOpen
objstreamWrite body
objstreamPosition =
objstreamType =
objstreamCharset =Cset
BytesToBstr = objstreamReadText
objstreamClose
set objstream = nothing
End Function
dim vUrlTempStr
vUrl="
TempStr=GetResStr(vUrl"gb")
responsewrite "您的IP为(asp教程获取真实IP):"&split(TempStr"""")()" " &split(TempStr"""")()" "&replace(split(TempStr"""")()"市""")
%>
ASP 获取腾讯IP地址的接口程序代码