ASP小偷程序原理和示例源碼
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
[align=left]現(xiàn)在網(wǎng)上流行的小偷程序比較多,有新聞?lì)愋⊥担魳?lè)小偷,下載小偷,那么它們是如何做的呢,下面我來(lái)做個(gè)簡(jiǎn)單介紹,希望對(duì)各位站長(zhǎng)有所幫助。 [br] (一)原理 [br] 小偷程序?qū)嶋H上是通過(guò)了xml中的xmlhttp組件調(diào)用其它[url=http://gougou.com/search?search=網(wǎng)站;&id=24304]網(wǎng)站[/url]上的[url=http://gougou.com/search?search=網(wǎng)頁(yè);&id=24304]網(wǎng)頁(yè)[/url]。比如新聞小偷程序,很多都是調(diào)用了sina的新聞[url=http://gougou.com/search?search=網(wǎng)頁(yè);&id=24304]網(wǎng)頁(yè)[/url],并且對(duì)其中的html進(jìn)行了一些替換,同時(shí)對(duì)廣告也進(jìn)行了過(guò)濾。用小偷程序的優(yōu)點(diǎn)有:無(wú)須維護(hù)[url=http://gougou.com/search?search=網(wǎng)站;&id=24304]網(wǎng)站[/url],因?yàn)樾⊥党绦蛑械臄?shù)據(jù)來(lái)自其他[url=http://gougou.com/search?search=網(wǎng)站;&id=24304]網(wǎng)站[/url],它將隨著該[url=http://gougou.com/search?search=網(wǎng)站;&id=24304]網(wǎng)站[/url]的更新而更新;可以節(jié)省[url=http://gougou.com/search?search=服務(wù)器;&id=24304]服務(wù)器[/url]資源,一般小偷程序就幾個(gè)文件,所有[url=http://gougou.com/search?search=網(wǎng)頁(yè);&id=24304]網(wǎng)頁(yè)[/url]內(nèi)容都是來(lái)自其他[url=http://gougou.com/search?search=網(wǎng)站;&id=24304]網(wǎng)站[/url]。缺點(diǎn)有:不穩(wěn)定,如果目標(biāo)[url=http://gougou.com/search?search=網(wǎng)站;&id=24304]網(wǎng)站[/url]出錯(cuò),程序也會(huì)出錯(cuò),而且,如果目標(biāo)[url=http://gougou.com/search?search=網(wǎng)站;&id=24304]網(wǎng)站[/url]進(jìn)行升級(jí)維護(hù),那么小偷程序也要進(jìn)行相應(yīng)修改;速度,因?yàn)槭沁h(yuǎn)程調(diào)用,速度和在本地[url=http://gougou.com/search?search=服務(wù)器;&id=24304]服務(wù)器[/url]上讀取數(shù)據(jù)比起來(lái),肯定要慢一些。 [br] (二)事例 [br] [br] 下面就xmlhttp在asp中的應(yīng)用做個(gè)簡(jiǎn)單說(shuō)明 [br] [br] <-% [br] '常用函數(shù) [br] [br] '1、輸入url目標(biāo)[url=http://gougou.com/search?search=網(wǎng)頁(yè);&id=24304]網(wǎng)頁(yè)[/url]地址,返回值gethttppage是目標(biāo)[url=http://gougou.com/search?search=網(wǎng)頁(yè);&id=24304]網(wǎng)頁(yè)[/url]的html[url=http://gougou.com/search?search=代碼;&id=24304]代碼[/url] [br] function gethttppage(url) [br] dim http [br] set http=server.createobject("msxml2.xmlhttp") [br] http.open "get",url,false [br] http.send() [br] if http.readystate<>4 then [br] exit function [br] end if [br] gethttppage=bytestobstr(http.responsebody,"gb2312") [br] set http=nothing [br] if err.number<>0 then err.clear [br] end function [br] [br] '2、轉(zhuǎn)換亂瑪,直接用xmlhttp調(diào)用有中文字符的[url=http://gougou.com/search?search=網(wǎng)頁(yè);&id=24304]網(wǎng)頁(yè)[/url]得到的將是亂瑪,可以通過(guò)adodb.stream組件進(jìn)行轉(zhuǎn)換 [br] function bytestobstr(body,cset) [br] dim objstream [br] set objstream = server.createobject("adodb.stream") [br] objstream.type = 1 [br] objstream.mode =3 [br] objstream.open [br] objstream.write body [br] objstream.position = 0 [br] objstream.type = 2 [br] objstream.charset = cset [br] bytestobstr = objstream.readtext [br] objstream.close [br] set objstream = nothing [br] end function [br] [br] [br] [br] [br] '下面試著調(diào)用http://3doing.com/earticle/的html內(nèi)容 [br] dim url,html [br] url="http://3doing.com/earticle/" [br] html = gethttppage(url) [br] response.write html [br] %-> [/align]
該文章在 2010/6/27 17:24:56 編輯過(guò) |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |