欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

如何寫ASP入庫小偷程序

 更新時(shí)間:2007年06月06日 00:00:00   作者:  
現(xiàn)在網(wǎng)上流行的小偷程序比較多,有新聞?lì)愋⊥担魳沸⊥?,下載小偷,那么它們是如何做的呢,下面我來做個(gè)簡單介紹,希望對(duì)各位站長有所幫助。
(一)原理
小偷程序?qū)嶋H上是通過了XML中的XMLHTTP組件調(diào)用其它網(wǎng)站上的網(wǎng)頁。比如新聞小偷程序,很多都是調(diào)用了sina的新聞網(wǎng)頁,并且對(duì)其中的html進(jìn)行了一些替換,同時(shí)對(duì)廣告也進(jìn)行了過濾。用小偷程序的優(yōu)點(diǎn)有:無須維護(hù)網(wǎng)站,因?yàn)樾⊥党绦蛑械臄?shù)據(jù)來自其他網(wǎng)站,它將隨著該網(wǎng)站的更新而更新;可以節(jié)省服務(wù)器資源,一般小偷程序就幾個(gè)文件,所有網(wǎng)頁內(nèi)容都是來自其他網(wǎng)站。缺點(diǎn)有:不穩(wěn)定,如果目標(biāo)網(wǎng)站出錯(cuò),程序也會(huì)出錯(cuò),而且,如果目標(biāo)網(wǎng)站進(jìn)行升級(jí)維護(hù),那么小偷程序也要進(jìn)行相應(yīng)修改;速度,因?yàn)槭沁h(yuǎn)程調(diào)用,速度和在本地服務(wù)器上讀取數(shù)據(jù)比起來,肯定要慢一些。
(二)事例
下面就XMLHTTP在ASP中的應(yīng)用做個(gè)簡單說明

代碼: <%
'常用函數(shù)
'1、輸入url目標(biāo)網(wǎng)頁地址,返回值getHTTPPage是目標(biāo)網(wǎng)頁的html代碼
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP"
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312"
set http=nothing
if err.number<>0 then err.Clear
end function
'2、轉(zhuǎn)換亂瑪,直接用xmlhttp調(diào)用有中文字符的網(wǎng)頁得到的將是亂瑪,可以通過adodb.stream組件進(jìn)行轉(zhuǎn)換
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream"
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
'下面試著調(diào)用http://www.998w.net/class/的html內(nèi)容
Dim Url,Html
Url="http://www.998w.net/class/"
Html = getHTTPPage(Url)
Response.write Html
%>
------------------------------------------------------
代碼:
'代碼用XMLHTTP讀取遠(yuǎn)程文件
<%
Response.Buffer = True
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP"
xml.Open "GET", "http://www.998w.net/down/998w1.0.rar", False
xml.Send
' Add a header to give it a file name:
Response.AddHeader "Content-Disposition", _
"attachment;filename=mitchell-pres.zip"
' Specify the content type to tell the browser what to do:
Response.ContentType = "application/zip"
' Binarywrite the bytes to the browser
Response.BinaryWrite xml.responseBody
Set xml = Nothing
%> 

相關(guān)文章

最新評(píng)論