PostHttpPage用asp是实现模拟登录效果的代码

2018-09-06 11:15

阅读:446

  ==================================================
函数名:PostHttpPage
作用:登录
==================================================
FunctionPostHttpPage(RefererUrl,PostUrl,PostData)
DimxmlHttp
DimRetStr
SetxmlHttp=CreateObject(Msxml2.XMLHTTP)
xmlHttp.OpenPOST,PostUrl,False
XmlHTTP.setRequestHeaderContent-Length,Len(PostData)
xmlHttp.setRequestHeaderContent-Type,application/x-
xmlHttp.setRequestHeaderReferer,RefererUrl
xmlHttp.SendPostData
IfErr.Number<>0Then
SetxmlHttp=Nothing
PostHttpPage=$False$
ExitFunction
EndIf
PostHttpPage=bytesToBSTR(xmlHttp.responseBody,GB2312)
SetxmlHttp=nothing
EndFunction


评论


亲,登录后才可以留言!