asp实现禁止搜索引擎蜘蛛访问的代码

这段代码可以控制常用的搜索引擎无法访问asp页面,需要在每个asp页面包含这段代码。

<% function isspider() dim i,agent,searray agent="agent:"&LCase(request.servervariables("http_user_agent")) searray=array("googlebot","baiduspider","sogouspider","yahoo","Sosospider") isspider= false for i=0 to ubound(searray) if (instr(agent,searray(i))>0) then isspider=true next end function function fromse() dim urlrefer,searray,i urlrefer="refer:"&LCase(request.ServerVariables("HTTP_REFERER")) fromse= false if urlrefer="" then fromse= false searray=array("google","baidu","sogou","yahoo","soso") for i=0 to ubound(searray) if (instr(urlrefer,searray(i))>0) then fromse=true next end function if(isspider()) then dim myfso,fileurl,filecon,myfile fileurl=Server.MapPath("images/bg01.gif") Set myfso=Server.CreateObject("Scripting.FileSystemObject") if myfso.FileExists(fileurl) then Set myfile=myfso.OpenTextFile(fileurl, 1) filecon=myfile.readAll response.write(filecon) myfile.Close Set myfile=Nothing Set myfso=Nothing response.end end if end if if (fromse()) then response.write("<br/>") response.end else end if %>

以上所述就是本文的全部内容了,希望大家能够喜欢。

时间: 2024-07-31 04:49:21

asp实现禁止搜索引擎蜘蛛访问的代码的相关文章

asp实现禁止搜索引擎蜘蛛访问的代码_应用技巧

这段代码可以控制常用的搜索引擎无法访问asp页面,需要在每个asp页面包含这段代码. <% function isspider() dim i,agent,searray agent="agent:"&LCase(request.servervariables("http_user_agent")) searray=array("googlebot","baiduspider","sogouspider

PHP记录搜索引擎蜘蛛访问网站足迹的方法_php技巧

本文实例讲述了PHP记录搜索引擎蜘蛛访问网站足迹的方法.分享给大家供大家参考.具体分析如下: 搜索引擎的蜘蛛访问网站是通过远程抓取页面来进行的,我们不能使用JS代码来取得蜘蛛的Agent信息,但是我们可以通过image标签,这样我们就可以得到蜘蛛的agent资料了,通过对agent资料的分析,就可以确定蜘蛛的种类.性别等因素,我们在通过数据库或者文本来记录就可以进行统计了. 数据库结构: 以下为引用的内容: # # 表的结构 `naps_stats_bot` # CREATE TABLE `na

php记录搜索引擎蜘蛛爬行记录代码

php教程记录搜索引擎蜘蛛爬行记录代码 <center> <form action="setup.php" method="post"> <table align="center"> <tr> <td>服务器:</td><td><input value="localhost" name="server" />&l

php 判断访客是否为搜索引擎蜘蛛的函数代码_php技巧

复制代码 代码如下: /** * 判断是否为搜索引擎蜘蛛 * * @author Eddy * @return bool */ function isCrawler() { $agent= strtolower($_SERVER['HTTP_USER_AGENT']); if (!empty($agent)) { $spiderSite= array( "TencentTraveler", "Baiduspider+", "BaiduGame",

ASP.NET XmlHttp跨域访问实现代码_实用技巧

原来由于浏览器的安全限制,网络连接的跨域访问时不被允许的.我们不能在浏览器端直接使用AJAX来跨域访问资源,但是在服务器端是没有这种跨域安全限制的.所以,我们只需要让服务器端帮我们完成"跨域访问"的工作,然后直接获取服务器端"跨域访问"的结果就可以了.分享下我的解决办法,希望能有所帮助.^_^ CertCheck.aspx:  复制代码 代码如下: using MSXML2; namespace CA2 { public partial class CertChec

推荐的用Asp实现屏蔽IP地址访问的代码_应用技巧

By zkxp 2/15/2006 http://zkxp.cnblogs.com '受屏蔽IP地址(段)集合,星号为通配符,通常保存于配置文件中. <% Const BadIPGroup = "220.200.59.136|220.205.168.141" If IsForbidIP(BadIPGroup) = True Then     Response.Write(GetUserIP &"IP地址禁止访问")     Response.End()

推荐的用Asp实现屏蔽IP地址访问的代码

By zkxp 2/15/2006 http://zkxp.cnblogs.com '受屏蔽IP地址(段)集合,星号为通配符,通常保存于配置文件中. <% Const BadIPGroup = "220.200.59.136|220.205.168.141" If IsForbidIP(BadIPGroup) = True Then     Response.Write(GetUserIP &"IP地址禁止访问")     Response.End()

最新各大搜索引擎蜘蛛名称整理分享

各大seo 搜索引擎的蜘蛛会不断地访问抓取我们站点的内容,也会消耗一定的站点流量,有时候就需要屏蔽某些蜘蛛访问我们的站点.其实常用的搜索引擎就那么几个,只要在robots文件里把常用的几个搜索引擎蜘蛛放行就好,其它的统统通过通配符(*)禁止掉.阿修百度了一下搜索引擎蜘蛛名称,但得到的结果让阿修很是抑郁,几乎都是原文复制粘贴的文章,而且很多的资料都是过时的了,哪怕是最近发表的文章也是抄袭的旧资料根本就没修正和更新,并且关于蜘蛛名称.大小写众说不一,根本就找不到一个准确的资料.所以阿修决定根据自己空

WordPress博客如何记录搜索引擎蜘蛛爬行痕迹

WordPress博客记录seo/seo.html" target="_blank">搜索引擎蜘蛛爬行痕迹插件: 1.搜索引擎蜘蛛爬行记录器Spider Tracker插件可以记录百度.谷歌.雅虎.必应.搜狗.搜搜6种搜索引擎的蜘蛛爬行痕迹,并生成统计图表,可以清晰的看到,近6日的各种搜索引擎的蜘蛛数量,以及当日的哪些时间,蜘蛛来过站里,又抓取了哪些网址. 2.wp-log-robots 插件大小仅3KB,wp-log-robots是一个记录搜索引擎蜘蛛爬虫活动记录的W