<%
function
getHTTPPage(url)
dim Http
set
Http=server.createobject("MSXml2.XmlHTTP")
Http.open
"GET",url,false
Http.send()
if Http.readystate<>4
then
exit function
else
If Http.status=200
Then
response.write
replace(BytesToBstr(http.responseBody,"gb2312"),chr(10),"")
End If
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set
http=nothing
if err.number<>0 then err.Clear
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
Dim Url,Html,Usg,id
id=Request("id")
Url="
http://www.daokerstest.com/test.asp&u="+id
Html
= getHTTPPage(Url)
Response.write Html
'此代码修改自
http://www.stubc.com/thread-465-1-3.html
%>