服务热线
13975818321
TOP
一段ASP防采集的代码
作者:客服中心    文章来源:本站原创    点击数: 4843    更新时间:2007/10/16

 

前几天接到客户的反馈,说他的站点页面被taobao站点引用,导致自己服务器的流量过大,需要提供对策,但是还不能屏蔽了taobao站点,我们再三考虑分析,可以使用如下代码:
一,防复制粘贴:
<%        '作用:文字防复制乱码 函数
        'Date:2006-3-6
        '作者:blue2004
        '参数str 为原文,str1作者也是你自己,reslut产生乱码的种子
        Function ReadToCode(str,Str1,result)
                dim name
                dim i,j,k
                If isnull(str) then
                        ReadToCode=""
                        Exit Function
                End If
                Randomize
                k=instr(str,"</P>")
                Do while k>0
                        result=""
                        for i=0 to 19
                                j=Int(128 * Rnd)+1
                                if j=60 or j=62 then
                                        j=j+1
                                end if
                                result =result&chr(j) ' 产生随机数。
                            next
                        result="<span style='DISPLAY: none'>"&result&"</span>"
                        str=replace(str,"</p>",result&"<'/p