PostHttpPage用asp是实现模拟登录效果的代码
发布时间:2016-12-29 来源:查字典编辑
摘要:'=================================================='函数名:PostHttpPage'作...
'==================================================
'函数名:PostHttpPage
'作用:登录
'==================================================
FunctionPostHttpPage(RefererUrl,PostUrl,PostData)
DimxmlHttp
DimRetStr
SetxmlHttp=CreateObject("Msxml2.XMLHTTP")
xmlHttp.Open"POST",PostUrl,False
XmlHTTP.setRequestHeader"Content-Length",Len(PostData)
xmlHttp.setRequestHeader"Content-Type","application/x-www-form-urlencoded"
xmlHttp.setRequestHeader"Referer",RefererUrl
xmlHttp.SendPostData
IfErr.Number<>0Then
SetxmlHttp=Nothing
PostHttpPage="$False$"
ExitFunction
EndIf
PostHttpPage=bytesToBSTR(xmlHttp.responseBody,"GB2312")
SetxmlHttp=nothing
EndFunction