用户操作
[留言]  [发消息]  [加为好友] 
订阅我的博客
XML聚合    FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
Equn的公告
文章分类
    存档

    原创  网络小偷 收藏

    一段从网页上偷数据的ASP程序。

    <%
    Const adTypeBinary = 1
    Const adTypeText = 2

    Function Bytes2bStr(vin)
    Dim BytesStream,StringReturn
    Set BytesStream = Server.CreateObject("ADODB.Stream")
    With BytesStream
        .Type = adTypeText
        .Open
        .WriteText vin
        .Position = 0
        .Charset = "GB2312"
        .Position = 2
        StringReturn = .ReadText
        .close
    End With
    Set BytesStream = Nothing
    Bytes2bStr = StringReturn
    End Function

    url="http://www.qx121.com/information/tqyb/shortnb_output.asp?"&time()&""
    set oSend=createobject("Microsoft.XMLHTTP")
    SourceCode = oSend.open ("GET",url,false)
    oSend.send()
    if err.number<>0 then
    Response.write err.description
    Response.End()
    end if 
    SourceCode = bytes2BSTR(oSend.responseBody)

    bodystart=instr(SourceCode,"</tr>-->")
    bodyend1=instr(bodystart,SourceCode,"值班预报员")
    if not bodyend1=0 then
     bodyend=InstrRev(SourceCode,"</tr",bodyend1)
    end if
    if bodystart=0 or bodyend1=0 or bodyend=0 then
      body="连接服务器时出错,请稍后再试!"
     else
     body=mid(SourceCode,bodystart+8,bodyend-bodystart-4)
    end if

    set SourceCode=nothing
    '显示获取的内容,同样你也可以在这里写入库语句
    response.Write(body)
     %>

    发表于 @ 2004年07月05日 18:20:00 | 评论( loading... ) | 编辑| 举报| 收藏

    旧一篇:在HTM中引用VB6的OCX控件 | 新一篇:数据库分页存储过程

    • 发表评论
    • 评论内容:
    •  
    Copyright © Equn
    Powered by CSDN Blog