标题:XMLHTTP小偷
只看楼主
mextb1860
Rank: 1
等 级:新手上路
帖 子:179
专家分:0
注 册:2005-7-10
 问题点数:0 回复次数:0 
XMLHTTP小偷

<%
Function getHTTPPage(url)
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=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
%>
<%

lsstr=getHTTPPage("http://www.baidu.com")

response.write lsstr
%>

------------------------------------------------------
Http.open "GET",url,false ====>这里是建立连接是不是?
Http.send() ============>这里是发消息.他返回的内容是什么类型的?是字符串还是2进制的

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
这里又是什么意思啊?

搜索更多相关主题的帖子: 小偷 XMLHTTP 
2006-04-02 18:08



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-54611-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021247 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved