网络小偷

来源:互联网 发布:怎样配置java运行环境 编辑:程序博客网 时间:2024/04/30 03:37

一段从网页上偷数据的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)
 %>

原创粉丝点击