0" /> 返回顶部
关闭软件导航
位置:首页 > 技术分享 > SEO优化>asp判定是蜘蛛还是普通访问的代码

asp判定是蜘蛛还是普通访问的代码,这是在网上找的,虽然天线猫SEO团队不用类似这种作弊的方式,但是看到有网友咨询这个问题,所以就搜集一下:

0then

GetBot="google"

asp判定是蜘蛛还是普通访问的代码

endif

ifinstr(1,s_agent,"msnbot",1)>0then

GetBot="MSN"

endif

ifinstr(1,s_agent,"slurp",1)>0then

GetBot="Yahoo"

endif

ifinstr(1,s_agent,"baiduspider",1)>0then

GetBot="baidu"

endif

ifinstr(1,s_agent,"sohu-search",1)>0then

GetBot="Sohu"

endif

ifinstr(1,s_agent,"lycos",1)>0then

GetBot="Lycos"

endif

ifinstr(1,s_agent,"robozilla",1)>0then

GetBot="Robozilla"

endif

endfunction

ifGetBot="baidu"then

'给百度定制的内容

elseifGetBot="google"then

'给google定制的内容

endif

%>

下面是比较完整的代码需要的朋友也可以参考下。里面还包括了一些客户端信息。

复制代码代码如下:

ClassSystemInfo_Cls

PublicBrowser,version,platform,IsSearch,AlexaToolbar

PrivateSubClass_Initialize()

DimAgent,Tmpstr

IsSearch=False

IfNotIsEmpty(Session("SystemInfo_Cls"))Then

Tmpstr=Split(Session("SystemInfo_Cls"),"|||")

Browser=Tmpstr(0)

version=Tmpstr(1)

platform=Tmpstr(2)

AlexaToolbar=Tmpstr(4)

IfTmpstr(3)="1"Then

IsSearch=True

EndIf

ExitSub

EndIf

Browser="unknown"

version="unknown"

platform="unknown"

Agent=Request.ServerVariables("HTTP_USER_AGENT")

IfInStr(Agent,"AlexaToolbar")>0Then

AlexaToolbar="YES"

Else

AlexaToolbar="NO"

EndIf

IfLeft(Agent,7)="Mozilla"Then'有此标识为浏览器

Agent=Split(Agent,";")

IfInStr(Agent(1),"MSIE")>0Then

Browser="InternetExplorer"

version=Trim(Left(Replace(Agent(1),"MSIE",""),6))

ElseIfInStr(Agent(4),"Netscape")>0Then

Browser="Netscape"

Tmpstr=Split(Agent(4),"/")

version=Tmpstr(UBound(Tmpstr))

ElseIfInStr(Agent(4),"rv:")>0Then

Browser="Mozilla"

Tmpstr=Split(Agent(4),":")

version=Tmpstr(UBound(Tmpstr))

IfInStr(version,")")>0Then

Tmpstr=Split(version,")")

version=Tmpstr(0)

EndIf

EndIf

IfInStr(Agent(2),"NT5.2")>0Then

platform="Windows2003"

ElseIfInStr(Agent(2),"WindowsCE")>0Then

platform="WindowsCE"

ElseIfInStr(Agent(2),"NT5.1")>0Then

platform="WindowsXP"

ElseIfInStr(Agent(2),"NT4.0")>0Then

platform="WindowsNT"

ElseIfInStr(Agent(2),"NT5.0")>0Then

platform="Windows2000"

ElseIfInStr(Agent(2),"NT")>0Then

platform="WindowsNT"

ElseIfInStr(Agent(2),"9x")>0Then

platform="WindowsME"

ElseIfInStr(Agent(2),"98")>0Then

platform="Windows98"

ElseIfInStr(Agent(2),"95")>0Then

platform="Windows95"

ElseIfInStr(Agent(2),"Win32")>0Then

platform="Win32"

ElseIfInStr(Agent(2),"Linux")>0Then

platform="Linux"

ElseIfInStr(Agent(2),"SunOS")>0Then

platform="SunOS"

ElseIfInStr(Agent(2),"Mac")>0Then

platform="Mac"

ElseIfUBound(Agent)>2Then

IfInStr(Agent(3),"NT5.1")>0Then

platform="WindowsXP"

EndIf

IfInStr(Agent(3),"Linux")>0Then

platform="Linux"

EndIf

EndIf

IfInStr(Agent(2),"Windows")>0Andplatform="unknown"Then

platform="Windows"

EndIf

ElseIfLeft(Agent,5)="Opera"Then'有此标识为浏览器

Agent=Split(Agent,"/")

Browser="Mozilla"

Tmpstr=Split(Agent(1),"")

version=Tmpstr(0)

IfInStr(Agent(1),"NT5.2")>0Then

platform="Windows2003"

ElseIfInStr(Agent(1),"WindowsCE")>0Then

platform="WindowsCE"

ElseIfInStr(Agent(1),"NT5.1")>0Then

platform="WindowsXP"

ElseIfInStr(Agent(1),"NT4.0")>0Then

platform="WindowsNT"

ElseIfInStr(Agent(1),"NT5.0")>0Then

platform="Windows2000"

ElseIfInStr(Agent(1),"NT")>0Then

platform="WindowsNT"

ElseIfInStr(Agent(1),"9x")>0Then

platform="WindowsME"

ElseIfInStr(Agent(1),"98")>0Then

platform="Windows98"

ElseIfInStr(Agent(1),"95")>0Then

platform="Windows95"

ElseIfInStr(Agent(1),"Win32")>0Then

platform="Win32"

ElseIfInStr(Agent(1),"Linux")>0Then

platform="Linux"

ElseIfInStr(Agent(1),"SunOS")>0Then

platform="SunOS"

ElseIfInStr(Agent(1),"Mac")>0Then

platform="Mac"

ElseIfUBound(Agent)>2Then

IfInStr(Agent(3),"NT5.1")>0Then

platform="WindowsXP"

EndIf

IfInStr(Agent(3),"Linux")>0Then

platform="Linux"

EndIf

EndIf

Else

'识别搜索引擎

Dimbotlist,i

botlist="Google,Isaac,Webdup,SurveyBot,Baiduspider,ia_archiver,P.Arthur,FAST-WebCrawler,Java,Microsoft-ATL-Native,TurnitinBot,WebGather,Sleipnir"

botlist=Split(botlist,",")

Fori=0ToUBound(botlist)

IfInStr(Agent,botlist(i))>0Then

platform=botlist(i)&"搜索器"

IsSearch=True

ExitFor

EndIf

Next

EndIf

IfIsSearchThen

Browser=""

version=""

Session("SystemInfo_Cls")=Browser&"|||"&version&"|||"&platform&"|||1|||"&AlexaToolbar

Else

Session("SystemInfo_Cls")=Browser&"|||"&version&"|||"&platform&"|||0|||"&AlexaToolbar

EndIf

EndSub

EndClass

歌丛寻沙参饲拘趴正丢唤丘箩览叹拨跌操芬移毕检理鬼冤刻咬等敬近乘杏鼻业右阵蚕榨全皱存录揉扰根禁两位羊扁型哨址慎农财医饮堵爱屿接猜谣捡乓晕龟哑扁支柜茂援抄进脊江岁宣心掩沿农哈从希赌掏视净枪绞东屑晨捉壁历筛拼灶丸誉铺免礼视夕先灶尼抚情怖双亲商八师脏啦城会去老份泊软跳枝赴下避封芒鞭因挎sJ100J。asp判定是蜘蛛还是普通访问的代码。半山娱乐SEO优化技术在线,上海翼好seo优化公司,seo没内容,seo多久能做到首页,闪电精灵seo免费的吗?

如果您觉得 asp判定是蜘蛛还是普通访问的代码 这篇文章对您有用,请分享给您的好友,谢谢!