www.gusucode.com > 迅雷看看小偷电影程序源码+后台(首页去弹窗) > 迅雷看看小偷电影程序源码+后台(首页去弹窗)\code\detail.asp
<!--#include file="sql.asp"--><% %><!--#include file="Cache.asp"--><% dim content,myCache Set myCache = new cls_Cache myCache.name="detailasp"&Request.QueryString&"" if myCache.valid then content=myCache.value else On Error Resume Next Server.ScriptTimeOut=9999999 Function getHTTPPage(Path) t = GetBody(Path) getHTTPPage=BytesToBstr(t,"utf-8") End function Function GetBody(url) on error resume next Set Retrieval = CreateObject("M"&"icr"&"os"&"o"&"ft.X"&"ML"&"H"&"TT"&"P") With Retrieval .Open "Get", url, False, "", "" .Send GetBody = .ResponseBody End With Set Retrieval = Nothing End Function Function BytesToBstr(body,Cset) dim objstream set objstream = Server.CreateObject("a"&"d"&"od"&"b.s"&"tr"&"ea"&"m") 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 Function Newstring(wstr,strng) Newstring=Instr(lcase(wstr),lcase(strng)) if Newstring<=0 then Newstring=Len(wstr) End Function Dim wstr,str,url,start,over url="http://anime.xunlei.com/detail/"&Request.QueryString&"" wstr=getHTTPPage(url) start=Newstring(wstr,"您上次观看了最新 <a href=""/") over=Newstring(wstr,"<div class=""detail"">") body=mid(wstr,start,over-start) content=mid(body,instr(body,"vod"),instr(body,""" target")-instr(body,"vod")) myCache.add content,dateadd("n",180,now) end if set clsCache=nothing if content = "" then Response.Write "<h3>数据读取失败~~可能是XMLHTTP组件问题或是服务器所用的DNS解析问题,请联系空间商解决或换个空间测试一下~~~</h3>" else response.redirect "vod.asp?"&content end if %>