asp中xmlhttp组件发包

2018-09-06 13:19

阅读:537

  asp中xmlhttp组件发包
写的一个小偷函数,注意红色代码部分,其他的自己添加吧!
FunctionPostHttpPageFrom(HttpUrl,stra,FromUrl)
DimHttp
SetHttp=server.createobject(MSXML2.XMLHTTP)
Http.openPOST,HttpUrl,False
Http.setrequestheadercontent-length,len(stra)Http.setrequestheadercontent-
type,application/x-
Http.setrequestheaderReferer,FromUrl
Http.sendstra
IfHttp.Readystate<>4then
SetHttp=Nothing
GetHttpPage=$False$
Exitfunction
Endif
PostHttpPageFrom=bytesToBSTR(Http.responseBody,gb2312)SetHttp=Nothing
IfErr.number<>0then
Err.Clear
EndIf
EndFunction
FunctionBytesToBstr(Body,Cset)
DimObjstream
SetObjstream=Server.CreateObject(adodb.stream)
objstream.Type=1
objstream.Mode=3
objstream.Open1d)
objstream.Writebody
objstream.Position=0
objstream.Type=2
objstream.Charset=Cset
BytesToBstr=objstream.ReadText
objstream.Close
setobjstream=nothing
EndFunction


评论


亲,登录后才可以留言!