欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

asp中xmlhttp组件发包

程序员文章站 2022-07-01 23:46:13
asp中xmlhttp组件发包 写的一个小偷函数,注意红色代码部分,其他的自己添加吧! function posthttppagefrom(httpurl,str...

asp中xmlhttp组件发包
写的一个小偷函数,注意红色代码部分,其他的自己添加吧!
function posthttppagefrom(httpurl,stra,fromurl)
   dim http
set http=server.createobject("msxml2.xmlhttp")
   http.open "post",httpurl,false
   http.setrequestheader "content-length",len(stra)   http.setrequestheader "content-
type","application/x-www-form-urlencoded"
   http.setrequestheader "referer",fromurl
   http.send stra 
if http.readystate<>4 then
      set http=nothing 
gethttppage="$false$"
exit function
end if
posthttppagefrom=bytestobstr(http.responsebody,"gb2312")   set http=nothing
if err.number<>0 then
      err.clear
end if
end function
function bytestobstr(body,cset)
   dim objstream
set objstream = server.createobject("adodb.stream")
   objstream.type = 1
objstream.mode =3
objstream.open1 d)
objstream.write body
objstream.position = 0
objstream.type = 2
objstream.charset = cset
   bytestobstr = objstream.readtext
   objstream.close
   set objstream = nothing
end function