获取客户地理地址的ASP代码
来源:互联网 发布:dalo流控源码 编辑:程序博客网 时间:2024/04/30 04:56
<%
function GetResStr(URL,code)
err.clear
dim ResBody,ResStr,PageCode,ReturnStr
Set Http=server.createobject("Microsoft.XMLHTTP")
Http.open "GET",URL,False
Http.Send()
If Http.Readystate =4 Then
If Http.status=200 Then
ResBody=http.responseBody
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 reg,vUrl,VBody,code,time1,time2,title
vUrl="http://www.ip138.com/ips.asp?ip="&request.servervariables("REMOTE_ADDR")
TempStr=GetResStr(vUrl,"gb2312")
p1=instr(TempStr,"""")+1
p2=InStrRev(TempStr,"""")
Add=mid(TempStr,p1,p2-p1)
'自己的替换,截取地理地址
'shu=instr(TempStr,"参考数据二:")
'response.write shu
'response.end
dizhi1=split(TempStr,"参考数据二:")
dizhi2=split(dizhi1(1)," ")
dizhi3=dizhi2(0)
response.write "您的IP为:"&request.servervariables("REMOTE_ADDR")&"<br />"
response.write "您的位置:"&dizhi3&"<br />"
%>
- 获取客户地理地址的ASP代码
- 获取客户的IP地址
- asp获取ip地址的代码
- 获取客户真实的IP地址
- Nginx获取客户真实的IP地址
- asp.net 获取html代码中图片的URL地址
- ip地址获取本地所在地理区域
- JSP中获取访问客户的IP地址
- 获取IP地址的代码
- asp中获取当前页面的地址与参数的函数代码
- ASP获取真实的IP地址
- asp.net 获取请求页面的地址
- asp.net获取客户端的MAC地址
- asp获取上一页地址的方法
- ASP.NET获取ip地址的方法
- asp.net 获取上一个页面的地址
- apache+weblogic10g获取客户实际IP地址
- 获取访问网站客户ip地址
- opencv学习备注
- 支持列表的Form属性
- 随笔
- 最近的随想
- windows消息机制
- 获取客户地理地址的ASP代码
- error C3861: 'cvCreateHidHaarClassifierCascade': identifier not found
- 关于回调函数
- 面试题之二叉搜索树的中位数
- C#连接Oracle数据库
- 利用JavaScript创建随机数与随机图片
- 业余“菜农”年终总结
- 路由器 集线器 交换机的区别
- Oracle触发器基础