XMLHTTP抓取数据时乱码问题解决-ASP教程,XML相关
来源:作者: 发布时间:2007-12-26 03:23:05

内码问题.用这段代码的吧,我已改得很精简了.
使用xmlhttp抓取地址并进次内容处理
function getbody(url)
dim objxml
on error resume next
set objxml = createobject("microsoft.xmlhttp")
with objxml
.open "get", url, false, "", ""
.send
getbody = .responsebody
end with
getbody=bytestobstr(getbody,"gb2312")
set objxml = nothing
end function
使用adodb.stream处理二进制数据
function bytestobstr(strbody,codebase)
dim objstream
set objstream = server.createobject("adodb.stream")
objstream.type = 1
objstream.mode =3
objstream.open
objstream.write strbody
objstream.position = 0
objstream.type = 2
objstream.charset = codebase
bytestobstr = objstream.readtext
objstream.close
set objstream = nothing
end function
|
还没有关于此文章的相关评论!