您的位置:首页 > 理论基础 > 计算机网络

XMLHTTP小偷程序POST方法(ASP)

2005-12-21 01:35 399 查看
<%
Function GetSourceInfo(byval url,pages,Cookies)
    dim xmlhttp,xmlget,bgpos,endpos
    Set xmlhttp = CreateObject("Msxml2.ServerXMLHTTP")
    With xmlhttp
    .Open "POST", url, False
    .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
    '.setRequestHeader("Referer","来路的绝对地址")
    '.setRequestHeader "Cookie",Cookies   'Cookie
    .Send pages'post的参数
    xmlget = bin2str(.responseBody)
    End With
    set xmlhttp = nothing
    GetSourceInfo=xmlget
End Function
Function bin2str(binstr)
    Const adTypeBinary = 1
    Const adTypeText = 2
    Dim BytesStream,StringReturn
    Set BytesStream = Server.CreateObject("ADODB.Stream") '建立一个流对象
    With BytesStream
    .Type = adTypeText
    .Open
    .WriteText binstr
    .Position = 0
    .Charset = "GB2312"
    .Position = 2
    StringReturn = .ReadText
    .close
    End With
    Set BytesStream = Nothing
    bin2str = StringReturn
End Function
'--------------------------------------------------------------------------------------
Cookies = ""
pages = "curDate=2005-12-20&FlightWay1=Single&FlightWay=Single&Homecity="&escape("成都")&"&DDatePeriod1=2005-12-25&startPeriod=All&Destcity1="&escape("深圳")&"&TicketAgency_List="&escape("成都")&"&ChildType=ADU&Quantity=1&DSeatClass=Y&airlineChoice=All"

'GetSourceInfo(网址,提交的表单,Cookies)
response.write(GetSourceInfo("http://www.ctrip.com/supermarket/Flight/SuperFlightSearchResult.asp",pages,Cookies))
%>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  asp cookies function url list