インターネットからのコードはわずかに変更されており、キャッシュクラスが実際に使用されています。 。
たとえば、pic.aspなどのコードを保存します
使用:http://www.xxx.com/pic.asp?url=http://www.aaaa.com/log.gif
163だけでなく、反盗難の多くの写真も実現できます。
<%
'リンクの盗難の判断
'ifinstr(request.servervariables( "http_referer")、 "http://"&request.servervariables( "server_name")& "")= 0then
'Response.Write「違法リンク」
'Response.End
'endif
Dimurl、Body、Mycache
url = request.querystring( "url")
setMycache = newCache
mycache.name = "picindex"&url
ifmycache.validthen
body = mycache.value
それ以外
body = getwebdata(url)
mycache.addbody、dateadd( "d"、1、now)
endif
iferr.number = 0then
Response.Charset = "UTF-8"
Response.ContentType = "Application/Octet-Stream"
respons.binarywritebody
Response.Flush
それ以外
wscript.echer.description
endif
'データを取得します
publicFunctionGetWebData(byvalstrurl)
dimcurlpath
curlpath = mid(strurl、1、strur(8、strurl、 "/"))
Dimretrieval
setretrieval = server.createObject( "microsoft.xmlhttp")
withretrieval
。「get」、strur、false、 ""、 "
.setRequestheader "参照"、curlpath
。送信
getWebData = .ResponseBody
終わりに
setretrieval =何もない
エンド機能
'キャッシュクラス
classcache
privateobj'cacheコンテンツ
PrivateExpireTime'expiration時間
privateExpireTimename'expirationタイムアプリケーション名
privatecachename'cacheコンテンツアプリケーション名
privatepath'url
privatesubclass_initialize()
path = request.servervariables( "url")
PATH = left(path、instrrev(path、 "/"))
Endingub
privatesubclass_terminate()
Endingub
publicPropertygetblempty
「空ですか
ifsempty(obj)then
Blymenty = True
それ以外
Blymenty = false
endif
Endproperty
publicPropertygetValid
'利用可能かどうか(期限切れ)
ifsempty(obj)ornotisdate(expiretime)
有効= false
elseifcdate(expiretime)<nowthen
有効= false
それ以外
valid = true
endif