Python语言技术文档

微信小程序技术文档

php语言技术文档

jsp语言技术文档

asp语言技术文档

C#/.NET语言技术文档

html5/css技术文档

javascript

点击排行

您现在的位置:首页 > 技术文档 > asp技巧

asp获取腾讯IP地址的代码

来源:中文源码网    浏览:173 次    日期:2024-04-29 03:34:08
【下载文档:  asp获取腾讯IP地址的代码.txt 】


ASP 获取腾讯IP地址的代码
提问: 复制代码 代码如下: 如何用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),"市","") %>

相关内容