28,391
社区成员
发帖
与我相关
我的任务
分享
<%
dim Conn
dim Connstr
Connstr="driver={SQL Server};server=(local);uid=sa;pwd=sa;database=btd_2008"
set Conn=server.createobject("ADODB.ConnECTION")
Conn.Open Connstr
%>
<html>
<head>
<title>map point</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
dim rs,sql
Set rs=Server.CreateObject("ADODB.recordset")
dim rs2,sql2
Set rs2=Server.CreateObject("ADODB.recordset")
sql="select top 10 * from [chi] order by id desc"
rs.open sql,conn,1,1
do while not rs.eof
response.Write(rs("address"))
response.write("<br>")
Dim objXMLHTTP, xml ,url
url="http://maps.google.com/maps/geo?q="&rs("address")&"&output=csv&key=ABQIAAAApY6NQ62m5-TOY2lymdexQhRKJnXFZRSHqLJY8hfZWLGqzePaiBS094BmETWGgTSe1PWjqT-9nq5IWw"
response.write url
response.write "<br>"
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "get", url, False
xml.Send
Point=xml.responseText
response.Write(Point)
Set xml = Nothing
rs.movenext
loop
rs.close
set rs =nothing
set rs2 =nothing
set conn=nothing
%>
</body>
</html>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
dim Conn
dim Connstr
Connstr="driver={SQL Server};server=(local);uid=sa;pwd=sa;database=btd_2008"
set Conn=server.createobject("ADODB.ConnECTION")
Conn.Open Connstr
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="zh">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>map point</title>
</head>
<body >
<%
Function GetGeoinfo(address)
dim Url
Url="http://maps.google.com/maps/geo?q="+address+"&output=csv"
dim httpRequest
set httpRequest=Server.createobject("Microsoft.XMLHTTP")
httpRequest.open "GET",Url,false
httpRequest.send()
if httpRequest.readystate <>4 then
exit function
end If
dim pointxy,pointx,pointy
pointxy=httpRequest.responseText
pointxy=split(pointxy,",")
pointx=pointxy(2)
pointy=pointxy(3)
GetGeoinfo=pointx&"|"&pointy
set httpRequest=nothing
End Function
dim address
dim rs,sql
Set rs=Server.CreateObject("ADODB.recordset")
Dim objXMLHTTP, xml ,url
sql="select top 10 * from [point] order by id desc"
rs.open sql,conn,1,1
do while not rs.eof
address=rs("address")
response.write address
response.write "<br>"
response.write(GetGeoinfo(address))
response.write "<br>"
rs.movenext
loop
rs.close
set rs =nothing
set conn=nothing
%>
</body>
</html>