萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> jsp編程 >> 怎麼防止網頁的內容被別人采集

怎麼防止網頁的內容被別人采集

<%
'****************************************
' 怎麼防止網頁的內容被別人采集,非法的訪問你的網站
'****************************************
dim onlyURL,from '***指定來源網址...
onlyURL="http://127.0.0.1/"
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
%>

copyright © 萬盛學電腦網 all rights reserved