最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ASP 获取腾讯IP地址的接口程序代码
时间:2022-07-02 22:32:29 编辑:袖梨 来源:一聚教程网
如何用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.**q*q.com/ipaddress"
TempStr=GetResStr(vUrl,"gb2312")
response.write "您的IP为(获取真实IP):"&split(TempStr,"""")(1)" " &split(TempStr,"""")(5)" "&replace(split(TempStr,"""")(7),"市","")
%>
ASP 获取腾讯IP地址的接口程序代码
相关文章
- 如何用AI制作圆锥效果海报 03-25
- 拷贝漫画如何实现在线漫画下拉式 03-25
- 蚂蚁森林神奇海洋2026年3月24日答案 03-25
- 歪漫科技无删减漫画免费下载最新版本-搜索到的不一定能看在线安装入口 03-25
- Excel打印怎样使每一页都有标题行 03-25
- 千牛网页版客服系统官网链接是什么 03-25