教程集 www.jiaochengji.com
教程集 >  脚本编程  >  Asp  >  正文 ASP 获取腾讯IP地址的接口程序代码

ASP 获取腾讯IP地址的接口程序代码

发布时间:2016-09-28   编辑:jiaochengji.com
教程集为您提供ASP 获取腾讯IP地址的接口程序代码等资源,欢迎您收藏本站,我们将为您提供最新的ASP 获取腾讯IP地址的接口程序代码资源

<script type=text/javascript教程 src=http://fw.qq.com/ipaddress></script>
<script type=text/javascript>
var hehe1=IPData[2]
var hehe2=IPData[3]
alert(hehe1);
alert(hehe2);
document.write(IPData.join(' '));
</script>

如何用ASP来存储,从上面读取出来的数据呢。
回答:
复制代码 代码如下:
<%
function GetResStr(URL,code)
err.clear
dim Http,ReturnStr
Set Http=server.createobject("Microsoft.XMLHTTP")
Http.open "GET",URL,False
Http.Send()
If Http.Readystate =4 Then
If Http.status=200 Then
ReturnStr=BytesToBstr(http.responseBody,code)
GetResStr=ReturnStr
End If
End If
End Function
'函数名:BytesToBstr
'作用:转换二进制数据为字符
'参数:Body-二进制数据,Cset-文本编码方式
Function BytesToBstr(Body,Cset)
Dim Objstream
Set Objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset =Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
dim vUrl,TempStr
vUrl="http://fw.qq.com/ipaddress"
TempStr=GetResStr(vUrl,"gb2312")
response.write "您的IP为(asp教程获取真实IP):"&split(TempStr,"""")(1)" " &split(TempStr,"""")(5)" "&replace(split(TempStr,"""")(7),"市","")
%>

ASP 获取腾讯IP地址的接口程序代码

您可能感兴趣的文章:
腾讯与新浪的通过IP地址获取当前地理位置(省份)的接口
ASP 获取腾讯IP地址的接口程序代码
腾讯全民wifi连不上问题解决办法
PHP通过IP获取地理位置的代码
php腾讯ip分享计划获取IP地理位置
php 获取用户真实IP与地理位置(淘宝IP接口)的实现代码
php通过IP获取地理位置的实例参考
php获取ip地理信息几种方法
php根据IP地址获取当前地理位置接口
php通过IP获取地理位置

[关闭]
~ ~