| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 826 人关注过本帖
标题:关于一个ASP小偷程序求助
只看楼主 加入收藏
编程汉
Rank: 1
来 自:湖南长沙
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-5-17
收藏
 问题点数:0 回复次数:7 
关于一个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
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
怎么样的不行?是程序出错还是采集不到相关内容?
2008-05-17 14:21
编程汉
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
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
VBScript里,表示字符串的内容外面用双引号括起来:
url="http://www.baidu.com"
编译器(解释程序)遇到第二个双引号(结尾的那个)认为字符串结束。
如果字符串的内容要包含双引号,那么双写以转义:
str="<input type=""text"" />"

对于HTML标记,值可以使用单引号,也可以使用双引号,javascript中的字符串也是。因此可以这样:
<a onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.baidu.com')" href=http://utility.baidu.com/traf/click.php?id=215&url=http://www.baidu.com>把百度设为首页</a>
2008-05-17 14:48
海军
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-3-20
收藏
得分:0 
顶下.请版主看下.我的代码有错没?
2008-05-17 21:18
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
[bo]以下是引用 [un]海军[/un] 在 2008-5-17 21:18 的发言:[/bo]

顶下.请版主看下.我的代码有错没?

你真聪明……你的代码在哪里呀?
2008-05-17 21:44
编程汉
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
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
能运行得到结果代码就是没错,否则就是错了。程序是我执行还是电脑执行呐?
2008-05-21 18:14
快速回复:关于一个ASP小偷程序求助
数据加载中...
 
   



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

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