XMLHTTP小偷程序POST方法(ASP)

<%
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
想对作者说点什么? 我来说一句
相关热词

没有更多推荐了,返回首页

关闭
关闭
关闭