The image anti-Leech code (aspphp) is tested and passed. Php code is relatively simple: Copy the code as follows :? Php $ p $ _ GET [p]; $ picsfile ($ p); for ($ i0; $ icount ($ pics); $ I ++) {echo $ pics [$ I] ;}? Usage: it is relatively simple to save the file as an I php version code:
The code is as follows:
$ P = $ _ GET ['P'];
$ Pics = file ($ p );
For ($ I = 0; $ I <count ($ pics); $ I ++)
{
Echo $ pics [$ I];
}
?>
Usage: Save the file as I. php and upload it to the root directory.
Change the image address that cannot be chained to http: // your domain name p. php? P = Image address
Asp
The code is as follows:
<%
Dim url, body, myCache
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
'Get data
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
Set Retrieval = Nothing
End Function
'Cache class
Class Cache
Private obj 'cache content
Private expireTime 'expiration time
Private expireTimeName 'expiration Time application name
Private cacheName 'cache content application name
Private path 'URL
Private sub class_initialize ()
Path = request. servervariables ("url ")
Path = left (path, limit Rev (path ,"/"))
End sub
Private sub class_terminate ()
End sub
Public property get blEmpty
'Empty?
If isempty (obj) then
BlEmpty = true
Else
BlEmpty = false
End if
End property
Public property get valid
'Available (expired)
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)
'Set cache name
CacheName = str & path
Obj = application (cacheName)
ExpireTimeName = str & "expires" & path
ExpireTime = application (expireTimeName)
End property
Public property let expires (tm)
'Reset the Expiration Time
ExpireTime = tm
Application. lock
Application (expireTimeName) = expireTime
Application. unlock
End property
Public sub add (var, expire)
'Assign A value
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
'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 ()
'Release the application
Application. lock
Application (cacheName) = empty
Application (expireTimeName) = empty
Application. unlock
Obj = empty
ExpireTime = empty
End sub
Public function equal (var2)
'Comparison
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
%>
Usage: Save the file as I. asp and upload it to the root directory.
Change the image address that cannot be chained to http: // your domain name/p. asp? Url = Image address
For ease of use, the copied code is prone to errors. Special package download
The pipeline code is as follows :? Php $ p = $ _ GET ['P']; $ pics = file ($ p); for ($ I = 0; $ I count ($ pics ); $ I ++) {echo $ pics [$ I] ;}? Usage: Save the file as I...