Function IsSimulator '是否模拟器
IsSimulator=False
browser=array("msie","nokia toolkit","m3gate","waplite","EnterOtherSimulator")
Browserinfo=lcase(request.servervariables("HTTP_USER_AGENT"))
for i=0 to ubound(browser)
if instr(Browserinfo,browser(i))>0 then
IsSimulator=True
exit for
End IF
I=I+1
next
End Function
Function AllowPhone(AllowPhones,AllowSimulator) '参数一:充许手机串,以“;”为分隔符,参数二:是否充许模拟器;
dim allow,i,browserinfo
IF Allowphones="" Then
allow=true
else
allow=false
Browse=split(AllowPhones, ";")
Browserinfo=lcase(request.servervariables("HTTP_USER_AGENT"))
for i=0 to ubound(browse)
if instr(Browserinfo,browse(i))>0 then
allow=True
exit for
End IF
I=I+1
next
End if
'是模拟器且不充许模拟器访问或不是模拟器且含有不充许的手机串,则:
IF (ISSimulator and (not allowSimulator)) or ((not ISSImulator) and (not allow)) Then
allowphone=false
else
allowphone=true
End IF
End Function