从传统的ASP检测移动用户代理重定向会话启动 [英] Detect mobile user agent from classic ASP and redirect on session start
本文介绍了从传统的ASP检测移动用户代理重定向会话启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想检测移动用户代理,当会话在传统的ASP应用程序启动重定向他们。有谁知道拉这一关的好办法?
I'd like to detect a mobile user agent and redirect them when the session starts in a classic ASP app. Does anyone know a good way to pull this off?
推荐答案
在看看:
<一个href=\"http://mobiforge.com/developing/story/lightweight-device-detection-asp\">http://mobiforge.com/developing/story/lightweight-device-detection-asp
sub is_mobile()
Dim Regex, match
Set Regex = New RegExp
With Regex
.Pattern = "(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|palm|ipad)"
.IgnoreCase = True
.Global = True
End With
match = Regex.test(Request.ServerVariables("HTTP_USER_AGENT"))
If match
return True
Else
return False
End If
End Sub
*的声明:的的code可能无法正常工作,因为我没有方法来测试它与经典ASP的小knowleage
*Disclaimer: the code may not work, as I have no method to test it and little knowleage of classic ASP.
这篇关于从传统的ASP检测移动用户代理重定向会话启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文