成人午夜激情影院,小视频免费在线观看,国产精品夜夜嗨,欧美日韩精品一区二区在线播放

讓163網易相冊QQ相冊里的照片也能外鏈

2010-08-28 10:52:45來源:西部e網作者:

現在很多相冊都已經不能用外鏈了,比如常用的網易163相冊、QQ相冊、SOHU相冊等等,甚至一些博客上傳后的圖片也不能用做外鏈,破解它的方法其實網上早就有了,但是很少看到有直接做成小工具讓大家用的哈,這兩天似乎做這類小工具上癮了,每天都要做上一個,花不了幾分鐘時間,但是確十分有用哦~~~

今天又做了一個破解163網易相冊/QQ相冊/sohu相冊等在線小工具,用起來也不錯。
地址在:http://weste.net/tools/pic.aspx

其實原理很簡單,就是用一個中轉的程序把圖片度到cache里面,然后再顯示出來,本來我也想放一個程序的,但是發現似乎占用的內存還不小,用的少還不怕,要是大家都用我可是收不了!

所以我把PHP和ASP的代碼都給出來,以便以后誰用的上,代碼不是我寫的,我也是在網上找的哦~~~

PHP代碼:

    $pics=file($p);
    for($i=0;$i    {
          echo $pics[$i];
    }
?>


ASP代碼:
<%
'形如
'http://weste.net/pic.asp?url=http://img.photo.163.com/-C9z6fC8-rzRRU4hymYcuQ==/753789987632211589.jpg

Dim url, body, myCache
On Error Resume Next

url = Request.QueryString("url")

Set myCache = new cache
myCache.name = "picindex"&url
If myCache.valid Then
body = myCache.value
Else
body = GetWebData(url)
myCache.add body,dateadd("d",1,now)
End If

If Err.Number = 0 Then
Response.CharSet = "UTF-8"
Response.ContentType = "application/octet-stream"
Response.BinaryWrite body
Response.Flush
Else
Wscript.Echo Err.Description
End if

'取得數據
Public Function GetWebData(ByVal strUrl)
Dim curlpath
curlpath = Mid(strUrl,1,Instr(8,strUrl,"/"))
Dim Retrieval
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", strUrl, False,"",""
.setRequestHeader "Referer", curlpath
.Send
GetWebData =.ResponseBody
End With
Set Retrieval = Nothing
End Function


'cache類
class Cache
private obj 'cache內容
private expireTime '過期時間
private expireTimeName '過期時間application名
private cacheName 'cache內容application名
private path 'url

private sub class_initialize()
path=request.servervariables("url")
path=left(path,instrRev(path,"/"))
end sub

private sub class_terminate()
end sub

public property get blEmpty
'是否為空
if isempty(obj) then
blEmpty=true
else
blEmpty=false
end if
end property

public property get valid
'是否可用(過期)
if isempty(obj) or not isDate(expireTime) then
valid=false
elseif CDate(expireTime) valid=false
else
valid=true
end if
end property

public property let name(str)
'設置cache名
cacheName=str & path
obj=application(cacheName)
expireTimeName=str & "expires" & path
expireTime=application(expireTimeName)
end property

public property let expires(tm)
'重設置過期時間
expireTime=tm
application.lock
application(expireTimeName)=expireTime
application.unlock
end property

public sub add(var,expire)
'賦值
if isempty(var) or not isDate(expire) then
exit sub
end if
obj=var
expireTime=expire
application.lock
application(cacheName)=obj
application(expireTimeName)=expireTime
application.unlock
end sub

public property get value
'取值
if isempty(obj) or not isDate(expireTime) then
value=null
elseif CDate(expireTime) value=null
else
value=obj
end if
end property

public sub makeEmpty()
'釋放application
application.lock
application(cacheName)=empty
application(expireTimeName)=empty
application.unlock
obj=empty
expireTime=empty
end sub

public function equal(var2)
'比較
if typename(obj)<>typename(var2) then
equal=false
elseif typename(obj)="Object" then
if obj is var2 then
equal=true
else
equal=false
end if
elseif typename(obj)="Variant()" then
if join(obj,"^")=join(var2,"^") then
equal=true
else
equal=false
end if
else
if obj=var2 then
equal=true
else
equal=false
end if
end if

end function
end class
%>

<% 
'形如
'http://weste.net/pic.asp?url=http://img.photo.163.com/-C9z6fC8-rzRRU4hymYcuQ==/753789987632211589.jpg

Dim url, body, myCache 
On Error Resume Next

url = Request.QueryString("url") 

Set myCache = new cache 
myCache.name = "picindex"&url 
If myCache.valid Then 
  body = myCache.value 
Else 
  body = GetWebData(url) 
  myCache.add body,dateadd("d",1,now) 
End If 

If Err.Number = 0 Then 
  Response.CharSet = "UTF-8" 
  Response.ContentType = "application/octet-stream" 
  Response.BinaryWrite body 
  Response.Flush 
Else
  Wscript.Echo Err.Description
End if 

'取得數據 
Public Function GetWebData(ByVal strUrl) 
  Dim curlpath 
  curlpath = Mid(strUrl,1,Instr(8,strUrl,"/")) 
  Dim Retrieval 
  Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP") 
  With Retrieval 
    .Open "Get", strUrl, False,"","" 
    .setRequestHeader "Referer", curlpath 
    .Send 
    GetWebData =.ResponseBody 
  End With 
  Set Retrieval = Nothing 
End Function 


'cache類 
class Cache 
private obj 'cache內容 
private expireTime '過期時間 
private expireTimeName '過期時間application名 
private cacheName 'cache內容application名 
private path 'url 

private sub class_initialize() 
  path=request.servervariables("url") 
  path=left(path,instrRev(path,"/")) 
end sub 

private sub class_terminate() 
end sub 

public property get blEmpty 
'是否為空 
  if isempty(obj) then 
    blEmpty=true 
  else 
    blEmpty=false 
  end if 
end property 

public property get valid 
'是否可用(過期) 
  if isempty(obj) or not isDate(expireTime) then 
    valid=false 
  elseif CDate(expireTime)<now then 
    valid=false 
  else 
    valid=true 
  end if 
end property 

public property let name(str) 
'設置cache名 
  cacheName=str & path 
  obj=application(cacheName) 
  expireTimeName=str & "expires" & path 
  expireTime=application(expireTimeName) 
end property 

public property let expires(tm) 
'重設置過期時間 
  expireTime=tm 
  application.lock 
  application(expireTimeName)=expireTime 
  application.unlock 
end property 

public sub add(var,expire) 
'賦值 
  if isempty(var) or not isDate(expire) then 
    exit sub 
  end if 
  obj=var 
  expireTime=expire 
  application.lock 
  application(cacheName)=obj 
  application(expireTimeName)=expireTime 
  application.unlock 
end sub 

public property get value 
'取值 
  if isempty(obj) or not isDate(expireTime) then 
    value=null 
  elseif CDate(expireTime)<now then 
    value=null 
  else 
    value=obj 
  end if 
end property 

public sub makeEmpty() 
'釋放application 
  application.lock 
  application(cacheName)=empty 
  application(expireTimeName)=empty 
  application.unlock 
  obj=empty 
  expireTime=empty 
end sub 

public function equal(var2) 
'比較 
if typename(obj)<>typename(var2) then 
  equal=false 
elseif typename(obj)="Object" then 
  if obj is var2 then 
    equal=true 
  else 
    equal=false 
  end if 
elseif typename(obj)="Variant()" then 
  if join(obj,"^")=join(var2,"^") then 
    equal=true 
  else 
    equal=false 
  end if 
else 
  if obj=var2 then 
    equal=true 
  else 
    equal=false 
  end if 
end if 

end function 
end class 
%> 
注:轉載請注明來源于西部e網(weste.net),謝謝!

關鍵詞:ASP

贊助商鏈接:

主站蜘蛛池模板: 德庆县| 吉水县| 武邑县| 衡水市| 新乐市| 周口市| 长乐市| 扎囊县| 景德镇市| 清水县| 城固县| 凤台县| 全椒县| 南城县| 宜黄县| 沅陵县| 龙口市| 伊吾县| 旬邑县| 苍南县| 和龙市| 砚山县| 诸暨市| 信丰县| 昔阳县| 金寨县| 巴中市| 德格县| 洱源县| 富民县| 桐庐县| 柳江县| 平远县| 林芝县| 名山县| 融水| 衢州市| 拉萨市| 白朗县| 墨玉县| 葫芦岛市|