2026年10月31日 · 今日 0 帖 · 会员 6.1万 · 主题 17.4万
登录 · 注册 · 游客,欢迎随便逛逛
返回版块
1000
Lv9有为九子能等级图标
勋章勋章勋章勋章勋章
帖子
9.3万
回复
2,089
积分
60.3万
注册
2006-12-06
[怀旧国机]

自动识别手机或电脑的访问

[复制链接]
查看 127 回复 0
楼主 发表于 | 只看该作者

把下面的代码复制,要utf-8编码的,保

存为index.asp就可以了。注

意,index.asp的优先级要高于

default.asp。

也可以把default.asp改名为

index.asp

<%

rpath=“http://“&amp;Request.

ServerVariables

(“HTTP_HOST“)&“/“

dim agent,str,siteid,tourl

agent=request.ServerVariables

(“HTTP_USER_AGENT“)

if instr(agent,“Mozilla“)=0 then

tourl= “wap.asp“ ‘WAP page

toWML()

else

str=agent

str=replace(str,“Opera“,““)

str=replace(str,“SmartPhone“,““)

str=replace(str,“CE“,““)

str=replace(str,“UC“,““)

str=replace(str,“Symbian“,““)

str=replace(str,“NetFront“,““)

if Len(agent)=Len(str) then

response.redirect “default.asp“

‘web

else

tourl= “wap.asp“ ‘WAP page

toWML()

end if

end if

sub toWML()

response.redirect rpath&tourl

response.end

end sub%>

登录回复

登录后可以回复这个帖子。旧账号可使用原密码登录。

登录 注册新号
← 返回版块