一般情况下是通过UserAgent来判断的,找了两个版本的,可以参考下
C#版
public static bool IsWap(){
string agent =( Request.UserAgent+"").ToLower().Trim();
if(agent==""||agent.IndexOf("mozilla")!=-1||agent.IndexOf("opera")!=-1)return false;
return true;
}
VbjavaScript版
function iswap()
agent=trim(lcase(Request.UserAgent&""))
if agent="" or instr(agent,"mozilla")>0 or instr(agent,"opera")>0 then
iswap=false
else
iswap=true
end if
end function
本文作者:网友 来源:网络收集
CIO之家 www.ciozj.com 微信公众号:imciow