艺术迷网
艺术迷 >> 网页设计 >> asp学习 >> 一个简单的小偷程序
2006-9-5   作者:Tony   来源:艺术迷收集(fansart.com)   点击:1368
页面功能: 【评论】有错就点】 【字体: 】 【打印】 【关闭【收藏本页】收藏到365Key
 
对前一个网友的程序进行了少许修改,完成的一个非常简单的小偷程序。

说简单是因为,原网页就比较规则。所以只要是查找和替换,就可以将想要的内容提取出来,大概所有的ASP或者PHP生成的网页都有这个特点吧。

可惜不能把文件上载所以只能是把程序的列表拷贝下来:共两个文件,List.asp和dispArticle.Asp。我在本地实验是可以的,但是没有拿到网上测一下,也不知在网上行不。
List.asp:
<html><head><title>一个简单的小偷程序,希望您喜欢</title>
<META NAME='ROBOTS' CONTENT = 'All'>
<link href="CSS/css.css" rel="stylesheet" type="text/css">
</head>
<%
'Server.ScriptTimeOut=90
dim id,ccc_top,ccc_body

on error resume next
if Cint(request("page"))<=1 then
NoncePage=1
url="http://www.ynian.com/haha/List.Asp?ClassID=2"
else
NoncePage=request("page")
url="http://www.ynian.com/haha/List.Asp?ClassID=2&Page=" & CStr(NoncePage)
end if
'url="http://www.ynian.com/haha/List.Asp?ClassID=2"
ccc_code=getHTTPPage(url)
if err.number=0 then
start=Instr(ccc_code,"<table width=""100%"" border=""0"" cellspacing=""0"">")
over=Instr(ccc_code,"<script>document.title='永年信息网---乐翻天暴笑娱乐城 - 搞笑网文'</script>")
ccc_top=mid(ccc_code,start,over-start)
else
wscript.echo err.description
end if

%>
<body>
<CENTER>
<table border="1" width="750" cellspacing="0" cellpadding="0" bordercolorlight="#F1F1F1" bordercolordark="#FFFFFF"><%=ccc_top%></TD></TR></TBODY></TABLE>
<table border="1" width="750" cellspacing="0" cellpadding="0" bordercolorlight="#F1F1F1"

bordercolordark="#FFFFFF"></TD></TR></TBODY></TABLE>
</CENTER></BODY></HTML>
<%
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
%>
dispArticle.Asp:

<html><head><title>显示部分</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META NAME='ROBOTS' CONTENT = 'All'>
<link href="CSS/css.css" rel="stylesheet" type="text/css">
</head>
<%
'Server.ScriptTimeOut=90
dim id,ccc_top,ccc_body

on error resume next
if Cint(request("id"))<=1 then
NoncePage=94
url="http://www.ynian.com/haha/dispArticle.Asp?ID=94"
else
NoncePage=request("id")
url="http://www.ynian.com/haha/dispArticle.Asp?ID=" & CStr(NoncePage)
end if
'url="http://www.ynian.com/haha/List.Asp?ClassID=2"
ccc_code=getHTTPPage(url)
ccc_code = replace(ccc_code,"AsE??","Asp?id=")
if err.number=0 then
start=Instr(ccc_code,"<TD align=middle height=40 vAlign=center width=""98%"">")
over=Instr(ccc_code,"<strong>供稿:</strong>永年信息网---乐翻天暴笑娱乐城</TD>")
ccc_top=mid(ccc_code,start,over-start)
else
wscript.echo err.description
end if


%>
<body>
<CENTER>
<table border="1" width="750" cellspacing="0" cellpadding="0" bordercolorlight="#F1F1F1" bordercolordark="#FFFFFF"><%=over%></TD></TR></TBODY></TABLE>
<table border="1" width="750" cellspacing="0" cellpadding="0" bordercolorlight="#F1F1F1"

bordercolordark="#FFFFFF"><%=start%></TD></TR></TBODY></TABLE>
<table border="1" width="750" cellspacing="0" cellpadding="0" bordercolorlight="#F1F1F1"

bordercolordark="#FFFFFF"><%=ccc_top%></TD></TR></TBODY></TABLE>
</CENTER></BODY></HTML>
<%
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
%>
声明:本站刊载此文不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。如有疑问请与站长联系。
网友评论
目前没有评论!
发表评论
您的姓名: 匿名发送
电子邮件:
评论内容:
不能超过100个字符



所有留言只代表网友个人观点,不代表本站观点。
请各位遵纪守法并注意语言文明。
新闻搜索
关 键 词:
搜索范围:
全站精华
图文精彩
平面设计QQ群:42326012;技术群:38389792;
本站部分图文内容取自互联网。您若发现有侵犯您著作权行为,请及时告知,我们将在第一时间删除侵权作品、停止继续传播。
Copyright 2006-2007,版权所有 www.fansart.com tc_show@126.com QQ:44550498