实现ASP页面的防采集_ASP教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

推荐:解读提高MSSQL和ACCESS兼容性的方法
大家都知道ASP当中,最常用到的是ACCESS和MSSQL两个数据库。很多程序都想开发成两个数据库都可以使用的模式,但是碍于两个数据库得一些SQL语句不一致,所以导致很多程序都分两个没有必要的版本,就是ACCESS和MSSQL版!而事实上,我们可以通过对代码判断和识

自己写了一段防小偷采集的代码,与大家交流交流!

用法:
单独保存一个文件如(no.asp);
在相应的asp页面头部用<!--#include file="no.asp" -->加入即可!

<%
'****************************************
'* 网页防采集实现 *
'****************************************
dim onlyURL,from

'***指定来源网址...
onlyURL="/"

from=trim(request.serverVariables("HTTP_REFERER"))
if from="" then
'***来源为空:可能直接输入网址或小偷...
response.write "<div style='display:none'><p>拒绝小偷!!!"
response.write "<p>来自:" & from
response.write "<p>请访问:<a href='" & onlyURL & "'>" & onlyURL &"</a>"
response.write "<p><form name='blankForm' method=get action=''></form>"
response.write "<p><script language=""JavaScript"">blankForm.submit()</script>" & vbCRLF
response.end
else
if inStr(from,onlyURL)<>1 then
'***非指定来源:盗链...
response.write "<div style='display:none'><p>拒绝盗链!!!"
response.write "<p>来自:" & from
response.write "<p>请访问:<a href='" & onlyURL & "'>" & onlyURL &"</a>"
response.write "<p><form name='blankForm' method=get action=''></form>"
response.write "<p><script language=""JavaScript"">blankForm.submit()</script>"
response.end
else
'***来源正常,将访问后面的内容...
end if
end if
%>

来源:CSDN

分享:解析ASP隐藏下载地址及防盗代码
以下为引用的内容:

来源:模板无忧//所属分类:ASP教程/更新时间:2012-06-29
相关ASP教程