function gethttppage(url) 'asp 获取远程网页内容实例代码
dim http
set http=server.createobject(microsoft.xmlhttp)'建立xmlhttp对象
http.open get,url,false '设置http对象打开体例 get体例,url[连接页面地址],同步处理
http.send() '发送请求
if http.readystate<>4 then'对象处理状况为 非结束
exit function '退出函数
end if
gethttppage=bytestobstr(http.responsebody,gb2312)'bytestobstr获取的源码转换为中文的代码
set http=nothing '消灭对象
if err.number<>0 then err.clear '消灭错误
end function
'==================================================
'函数名:bytestobstr
'作 用:将获取的源码转换为中文
'参 数:body ------要转换的变量
'参 数:cset ------要转换的类型
'==================================================
function bytestobstr(body,cset)'bytestobstr获取的源码转换为响应的代码
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
怎样评判优化的好坏?美国cn2服务器的ping值是多少?如何判断新加坡云服务器的好坏?做seo是需要天天写文章吗【网络推广】这几种不为人知的网络推广误区你都知道吗?网站模板建站的发展趋势微信营销的营销策略有以下几点响应式网站的缺点和劣势