使用xmlhttp
给一个xmlhttp的简单例子<style type="text/css">
<!--
body{background: #fff;margin:0;}
table,td,img,form{border: none;margin: 0;padding: 0;}
td,p,li,select,input,textarea{font-size:12px;}
a{text-decoration:underline;}
a:link{color:#00007f;}
a:visited{color:#00007f;}
a:active,a:hover{color:#f00;}
-->
</style>
<% 
On Error Resume Next 
Server.ScriptTimeOut=9999999 
Function getHTTPPage(Path) 
t = GetBody(Path) 
getHTTPPage=BytesToBstr(t,"GB2312") 
End function 
Function GetBody(url) 
on error resume next 
Set Retrieval = CreateObject("Microsoft.XMLHTTP") 
With Retrieval 
.Open "Get", url, False, "", "" 
.Send 
GetBody = .ResponseBody 
End With 
Set Retrieval = Nothing 
End Function 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 
Function Newstring(wstr,strng) 
Newstring=Instr(lcase(wstr),lcase(strng)) 
if Newstring<=0 then Newstring=Len(wstr) 
End Function 
Dim wstr,str,url,start,over,dtime url="http://www.ip138.com/ip2city.asp"
wstr=getHTTPPage(url) 
start=Newstring(wstr,"[") 
over=Newstring(wstr,"]") 
body=mid(wstr,start+1,over-start-1)
start1=Newstring(wstr,"来自:") 
over1=Newstring(wstr,"</center>")
body1=mid(wstr,start1+3,over1-start1-3)
response.write body
response.write body1
%>