| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 826 人关注过本帖
标题:关于一个ASP小偷程序求助
取消只看楼主 加入收藏
编程汉
Rank: 1
来 自:湖南长沙
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-5-17
收藏
 问题点数:0 回复次数:2 
关于一个ASP小偷程序求助
Server.ScriptTimeOut=120
on error resume next  
url="http://www.baidu.com/s?wd='"&Y&"'"
softcode=getHTTPPage(url)
if err.number=0 then
start=Instr(softcode,"相关搜索")
over=Instr(softcode,"与百度对话")
musicOverId=ubound(Split(mid(softcode,start,over-start),"</td><td nowrap class='"s"'>&nbsp;</td>"))-1
if musicOverId<>"" then
for MusicStartID=1 to Gjc
start=Instr(softcode,"<td nowrap class='"f14"'>"&MusicStartID&"</td>")
if musicOverId=musicOverId then
over=Instr(softcode,"</html>")
else
over=Instr(softcode,"<td nowrap class='"f14"'>"&MusicStartID+1&"</td>")
end if
Txt=mid(softcode,start,over-start)
start=Instr(Txt,"tn=baidur>")+10
over=Instr(Txt,"</a>")
Txts=mid(Txt,start,over-start)
if Txts="" then
else
Set Rs = Server.CreateObject("ADODB.RecordSet")
Rs.Open "select * from E where E = '"&Txts&"'",Conn,1,3
If Rs.Eof Then
Rs.Addnew
Rs("E")=Txts
Rs("Yid")=request("Yid")
Eid=rs("Eid")
Rs.Update

一直不行.是采集百度的相关搜索的.请帮忙看看!
搜索更多相关主题的帖子: 小偷 ASP 程序 
2008-05-17 13:56
编程汉
Rank: 1
来 自:湖南长沙
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-5-17
收藏
得分:0 
musicOverId=ubound(Split(mid(softcode,start,over-start),"<td nowrap class='"s"'> </td>"))-1
if musicOverId<>"" then
for MusicStartID=1 to Gjc
start=Instr(softcode,"<td nowrap class='"f14"'>"&MusicStartID&"</td>")
if musicOverId=musicOverId then
over=Instr(softcode,"</html>")
else
over=Instr(softcode,"<td nowrap class='"f14"'>"&MusicStartID+1&"</td>")
单引号和双引号.总是闹不明白,求版主解答下!
2008-05-17 14:28
编程汉
Rank: 1
来 自:湖南长沙
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-5-17
收藏
得分:0 
原文
<!--#include file="conn.asp"-->
<%
Dbmdb_Urls=Session("Dbmdb_Urls")
dim conn
dim connstr
dim db
db=Dbmdb_Urls
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open connstr
On error resume next
function CloseDatabase
Conn.close
Set conn = Nothing
End Function
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
%>
<HTML>

<HEAD>
<TITLE>关键字词管理</TITLE>
<STYLE>
TD{FONT-SIZE: 9pt}
</STYLE>
<%
Yid=trim(request.form("Yid"))
Jsyid=trim(request.form("Jsyid"))
if trim(request.form("Gjc"))="" then
Gjc=request("Gjc")
else
Gjc=trim(request.form("Gjc"))
end if
if request("Yid")="" then
response.write "<SCRIPT language=JavaScript>alert('抓取关连词起始ID不能为空');location.replace(""?抓取关连词起始ID不能为空!"");</SCRIPT>"
Response.End
end if
if request("Jsyid")="" then
response.write "<SCRIPT language=JavaScript>alert('抓取关连词结束ID不能为空');location.replace(""?抓取关连词结束ID不能为空!"");</SCRIPT>"
Response.End
end if
'if request("Yid")>request("Jsyid")  then
'response.write "<SCRIPT language=JavaScript>alert('抓取关连词起始ID不能大于结束ID');location.replace(""?抓取关连词起始ID不能大于结束ID!"");</SCRIPT>"
'Response.End
'end if
set rs = server.createobject ("adodb.recordset")
rs.open "select * from Y where Yid="&request("Yid")&"",conn,1,3
if not Rs.eof then
Y=rs("Y")
rs("Yrq")=now
rs.update
end if
rs.close
response.write "<SPAN STYLE=""font-size: 9pt"">正在抓取“"&Y&"”的关连词(黑色表示录入成功,红色表示数据库已有记录不重复录入):</SPAN><br><br>"
Server.ScriptTimeOut=120
on error resume next  
url="http://d.baidu.com/rs.php?q="&Y&"&tn=baidu"
softcode=getHTTPPage(url)
if err.number=0 then
start=Instr(softcode,"<HTML>")
over=Instr(softcode,"</html>")
musicOverId=ubound(Split(mid(softcode,start,over-start),"<li class=ls>"))-1
if musicOverId<>"" then
for MusicStartID=1 to Gjc
start=Instr(softcode,"<li class=ls>"&MusicStartID&"</li>")
if musicOverId=musicOverId then
over=Instr(softcode,"</body>")
else
over=Instr(softcode,"<li class=ls>"&MusicStartID+1&"</li>")
end if
Txt=mid(softcode,start,over-start)
start=Instr(Txt,"tn=baidur>")+10
over=Instr(Txt,"</a>")
Txts=mid(Txt,start,over-start)
if Txts="" then
else
Set Rs = Server.CreateObject("ADODB.RecordSet")
Rs.Open "select * from E where E = '"&Txts&"'",Conn,1,3
If Rs.Eof Then
Rs.Addnew
Rs("E")=Txts
Rs("Yid")=request("Yid")
Eid=rs("Eid")
Rs.Update
response.write "<SPAN STYLE=""font-size: 9pt"">"&MusicStartID&"."&Txts&"("&Eid&")</SPAN><BR>"
Else
response.write "<SPAN STYLE=""font-size: 9pt""><FONT COLOR=#FF0000>"&MusicStartID&"."&Txts&"</SPAN><BR></FONT>"
End If
end if
NEXT
wscript.echo err.description
end if
end if
function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear  
end function
Function bytes2BSTR(vIn)
dim strReturn
dim i1,ThisCharCode,NextCharCode
strReturn = ""
For i1 = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i1,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i1+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i1 = i1 + 1
End If
Next
bytes2BSTR = strReturn
End Function
if request("Yid")=request("Jsyid") then
response.write "<SCRIPT language=JavaScript>alert('抓取关连词操作成功');location.replace(""Gjzcgl.asp?Zid="&request("Zid")&""");</SCRIPT>"
Response.End
Else
response.write "<script language=JavaScript>{window.location.href='"
response.write "?Yid="&request("Yid")+1&"&Jsyid="&request("Jsyid")&"&Gjc="&request("Gjc")&"&Zid="&request("Zid")
response.write "'}</script>"
Response.End
End If
%>
2008-05-21 16:25
快速回复:关于一个ASP小偷程序求助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031997 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved