伦理片hd-伦理片 在线播放-伦理片 在线-伦理免费在线观看-综合图片区-综合婷婷

訂閱本欄目 RSS您所在的位置: 深山工作室 > ASP > 正文

asp判斷是否是手機訪問

網(wǎng)絡(luò) 2015/3/11 9:06:06 深山 字體: 瀏覽 8031
asp判斷瀏覽器是否是手機版的,如果是手機版,就跳轉(zhuǎn)相應(yīng)的頁面

<%
qwbmmobilefeatures = "mini 9.5|vx1000|lge|m800|e860|u940|ux840|compal|wireless| mobi|ahong|lg380|lgku|lgu900|lg210|lg47|lg920|lg840|lg370|sam-r|mg50|s55|g83|t66|vx400|mk99|d615|d763|el370|sl900|mp500|samu3|samu4|vx10|xda_|samu5|samu6|samu7|samu9|a615|b832|m881|s920|n210|s700|c-810|_h797|mob-x|sk16d|848b|mowser|s580|r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|i250|sprint|w398samr810|m5252|c7100|mt126|x225|s5330|s820|htil-g1|fly v71|s302|-x113|novarra|k610i|-three|8325rc|8352rc|sanyo|vx54|c888|nx250|n120|mtk |c5588|s710|t880|c5005|i;458x|p404i|s210|c5100|teleca|s940|c500|s590|foma|samsu|vx8|vx9|a1000|_mms|myx|a700|gu1100|bc831|e300|ems100|me701|me702m-three|sd588|s800|8325rc|ac831|mw200|brew |d88|htc\/|htc_touch|355x|m50|km100|d736|p-9521|telco|sl74|ktouch|m4u\/|me702|8325rc|kddi|phone|lg |sonyericsson|samsung|240x|x320vx10|nokia|sony cmd|motorola|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo|iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile|ipod|iphone|android|opera mini|blackberry|palm os|palm|hiptop|avantgo|fennec|plucker|xiino|blazer|elaine|iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile|UC|Windows Phone|webOS|vnd.wap"


call Check_Wap()

Sub Check_Wap()
dim MoblieUrl,reExp,MbStr
Set reExp = New RegExp
MbStr="UC|Windows Phone|webOS|BlackBerry|iPod|vnd.wap|wap|symbian"
reExp.pattern=".*("&MbStr&").*"
reExp.IgnoreCase = True
reExp.Global = True
If reExp.test(Request.ServerVariables("HTTP_USER_AGENT")) Then
MoblieUrl="/3g/index.asp"''手機網(wǎng)站路徑
'response.redirect MoblieUrl
response.write "<font color='#f60'>這個是WAP手機版</font>"
'response.End
else
response.write "<font color='#09f'>這個是PC版</font>"
'response.End
End If
End Sub





'If instr(lcase(Request.ServerVariables("ALL_HTTP")),"vnd.wap")>0 or instr(lcase(Request.ServerVariables("ALL_HTTP")),"iphone")>0 or instr(lcase(Request.ServerVariables("ALL_HTTP")),"android")>0 or instr(lcase(Request.ServerVariables("ALL_HTTP")),"wap")>0 Or instr(lcase(Request.ServerVariables("All_HTTP")),"symbian") > 0 Or instr(lcase(Request.ServerVariables("All_HTTP")),"windows phone") > 0 Then
'response.Redirect("http://m.qwbm.com/?agent_id=494948")
'End If

'**************************************************

'函數(shù)名:websitez_detect_mobile_device

'作  用:判斷訪問瀏覽器的類型

'參  數(shù):

'返回值:瀏覽器類型

'函數(shù)名:regexpmobiletest

'作  用:在正則表達式中搜索給定的字符串,找到返回 true

'參  數(shù):

'返回值:布爾型

'日期:11-12-18




'**************************************************
Function regexpmobiletest(patrn, strng)
Dim regEx, retVal '建立變量
Set regEx=New RegExp '建立正則表達式
regEx.Pattern=patrn '設(shè)置模式
regEx.IgnoreCase=True '設(shè)置是否區(qū)分大小寫,true為不區(qū)分
retVal=regEx.Test(strng)'執(zhí)行搜索測試
regexpmobiletest=retVal
End Function 

function webmobilereturn(wmleis)
dim mobile_browser,user_agent, accept,mobile_browser_type
mobile_browser = "0"
user_agent=Trim(Lcase(Request.ServerVariables("HTTP_USER_AGENT")))
accept = Request.ServerVariables("HTTP_ACCEPT")
mobile_browser_type = "0" '0 - PC, 1 - Smart Phone, 2- Standard Phone  3 touch phone
'Select case true
if InStr(user_agent,"ipod")>0 or InStr(user_agent,"iphone")>0 or InStr(user_agent,"ipad")>0 then 'iPhone or iPod
mobile_browser = "1"
mobile_browser_type = "3" 'Smart Phone
elseif InStr(user_agent,"android")>0 then 'Android
mobile_browser = "1"
mobile_browser_type = "3" 'Smart Phone
elseif InStr(user_agent,"opera mini")>0 then 'Opera Mini
mobile_browser = "1"
mobile_browser_type = "1" 'Smart Phone
elseif InStr(user_agent,"blackberry")>0 then 'Blackberry
mobile_browser = "1"
mobile_browser_type = "1" 'Smart Phone
elseif InStr(user_agent,"series60")>0 or InStr(user_agent,"series 60")>0 then 'Symbian OS
mobile_browser = "1"
mobile_browser_type = "1" 'Smart Phone
elseif regexpmobiletest("(pre\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine)",user_agent) then 'Palm OS
mobile_browser = "1"
mobile_browser_type = "1" 'Smart Phone
elseif regexpmobiletest("(iris|3g_t|windows ce|opera mobi|iemobile)",user_agent) then 'Windows OS
mobile_browser = "1"
mobile_browser_type = "1" 'Smart Phone
elseif regexpmobiletest("(maemo|tablet|qt embedded|com2)",user_agent) then 'Nokia Tablet
mobile_browser = "1"
mobile_browser_type = "1" 'Smart Device
elseif regexpmobiletest("(mini 9.5|vx1000|lge |m800|e860|u940|ux840|compal|wireless| mobi|ahong|lg380|lgku|lgu900|lg210|lg47|lg920|lg840|lg370|sam-r|mg50|s55|g83|t66|vx400|mk99|d615|d763|el370|sl900|mp500|samu3|samu4|vx10|xda_|samu5|samu6|samu7|samu9|a615|b832|m881|s920|n210|s700|c-810|_h797|mob-x|sk16d|848b|mowser|s580|r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|i250|sprint|w398samr810|m5252|c7100|mt126|x225|s5330|s820|htil-g1|fly v71|s302|-x113|novarra|k610i|-three|8325rc|8352rc|sanyo|vx54|c888|nx250|n120|mtk |c5588|s710|t880|c5005|i;458x|p404i|s210|c5100|teleca|s940|c500|s590|foma|samsu|vx8|vx9|a1000|_mms|myx|a700|gu1100|bc831|e300|ems100|me701|me702m-three|sd588|s800|8325rc|ac831|mw200|brew |d88|htc\/|htc_touch|355x|m50|km100|d736|p-9521|telco|sl74|ktouch|m4u\/|me702|8325rc|kddi|phone|lg |sonyericsson|samsung|240x|x320|vx10|nokia|sony cmd|motorola|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo|vnd.rim|wml|nitro|nintendo|wii|xbox|archos|openweb|mini|docomo)",user_agent) then 'Mix of standard phones
mobile_browser = "1"
mobile_browser_type = "2" 'Standard Phone
elseif InStr(accept,"text/vnd.wap.wml")> 0 or InStr(accept,"application/vnd.wap.xhtml+xml")>0 then 'Any falling through the cracks
mobile_browser = "1"
mobile_browser_type = "2" 'Standard Phone
elseif Request.ServerVariables("HTTP_X_WAP_PROFILE")<>"" or Request.ServerVariables("HTTP_PROFILE")<>"" then 'Anyfalling through the cracks
mobile_browser = "1"
mobile_browser_type = "2" 'Standard Phone
elseif ubound(filter(array("1207","3gso","4thp","501i","502i","503i","504i","505i","506i","6310","6590","770","802s","a wa","acer","acs","airn","alav","asus","attw","au-m","aur ","aus ","abac","acoo","aiko","alco","alca","amoi","anex","anny","anyw","aptu","arch","argo","bell","bird","bw-n","bw-u","beck","benq","bilb","blac","c55/","cdm-","chtm","capi","cond","craw","dall","dbte","dc-s","dica","ds-d","ds12","dait","devi","dmob","doco","dopo","el49","erk0","esl8","ez40","ez60","ez70","ezos","ezze","elai","emul","eric","ezwa","fake","fly-","fly_","g-mo","g1 u","g560","gf-5","grun","gene","go.w","good","grad","hcit","hd-m","hd-p","hd-t","hei-","hp i","hpip","hs-c","htc ","htc-","htca","htcg","htcp","htcs","htct","htc_","haie","hita","huaw","hutc","i-20","i-go","i-ma","i230","iac","iac-","iac/","ig01","im1k","inno","iris","jata","java","kddi","kgt","kgt/","kpt ","kwc-","klon","lexi","lg g","lg-a","lg-b","lg-c","lg-d","lg-f","lg-g","lg-k","lg-l","lg-m","lg-o","lg-p","lg-s","lg-t","lg-u","lg-w","lg/k","lg/l","lg/u","lg50","lg54","lge-","lge/","lynx","leno","m1-w","m3ga","m50","maui","mc01","mc21","mcca","medi","meri","mio8","mioa","mo01","mo02","mode","modo","mot ","mot-","mt50","mtp1","mtv ","mate","maxo","merc","mits","mobi","motv","mozz","n100","n101","n102","n202","n203","n300","n302","n500","n502","n505","n700","n701","n710","nec-","nem-","newg","neon","netf","noki","nzph","o2 x","o2-x","opwv","owg1","opti","oran","p800","pand","pg-1","pg-2","pg-3","pg-6","pg-8","pg-c","pg13","phil","pn-2","pt-g","palm","pana","pire","pock","pose","psio","qa-a","qc-2","qc-3","qc-5","qc-7","qc07","qc12","qc21","qc32","qc60","qci-","qwap","qtek","r380","r600","raks","rim9","rove","s55/","sage","sams","sc01","sch-","scp-","sdk/","se47","sec-","sec0","sec1","semc","sgh-","shar","sie-","sk-0","sl45","slid","smb3","smt5","sp01","sph-","spv ","spv-","sy01","samm","sany","sava","scoo","send","siem","smar","smit","soft","sony","t-mo","t218","t250","t600","t610","t618","tcl-","tdg-","telm","tim-","ts70","tsm-","tsm3","tsm5","tx-9","tagt","talk","teli","topl","hiba","up.b","upg1","utst","v400","v750","veri","vk-v","vk40","vk50","vk52","vk53","vm40","vx98","virg","vite","voda","vulc","w3c ","w3c-","wapj","wapp","wapu","wapm","wig ","wapi","wapr","wapv","wapy","wapa","waps","wapt","winc","winw","wonu","x700","xda2","xdag","yas-","your","zte-","zeto","acs-","alav","alca","amoi","aste","audi","avan","benq","bird","blac","blaz","brew","brvw","bumb","ccwa","cell","cldc","cmd-","dang","doco","eml2","eric","fetc","hipt","http","ibro","idea","ikom","inno","ipaq","jbro","jemu","java","jigs","kddi","keji","kyoc","kyok","leno","lg-c","lg-d","lg-g","lge-","libw","m-cr","maui","maxo","midp","mits","mmef","mobi","mot-","moto","mwbp","mywa","nec-","newt","nok6","noki","o2im","opwv","palm","pana","pant","pdxg","phil","play","pluc","port","prox","qtek","qwap","rozo","sage","sama","sams","sany","sch-","sec-","send","seri","sgh-","shar","sie-","siem","smal","smar","sony","sph-","symb","t-mo","teli","tim-","tosh","treo","tsm-","upg1","upsi","vk-v","voda","vx52","vx53","vx60","vx61","vx70","vx80","vx81","vx83","vx85","wap-","wapa","wapi","wapp","wapr","webc","whit","winw","wmlb","xda-"),Mid(user_agent,1,4),true))>-1 then 'Catch all
mobile_browser = "1"
mobile_browser_type = "2" 'Standard Phone
'Case Else
else
mobile_browser = "0"
mobile_browser_type = "0"
'End Select
End if
if wmleis = "1" then
webmobilereturn = mobile_browser
else
webmobilereturn = mobile_browser_type
end if
end function

response.write webmobilereturn(0) & "___<br>"
response.write webmobilereturn(1) & "___<br>"
response.write mobile_browser & "___<br>"
response.write mobile_browser_type & "___<br>"
response.write user_agent & "___<br>"
response.write accept & "___<br>"
response.end



%>


相關(guān)閱讀
網(wǎng)站首頁head區(qū)代碼規(guī)范
微信小程序發(fā)送給朋友與分享到朋友圈顯示灰色的但是按鈕分享可以使用
理解css里的!important是什么意思?
div默認高度根據(jù)內(nèi)容自動適應(yīng)高度
深山旅行社網(wǎng)站管理系統(tǒng) v1.8
常見顯示器尺寸與分辨率對照
連云港華夏國際旅行社有限公司
CSS代碼格式化和壓縮化
共有0條關(guān)于《asp判斷是否是手機訪問》的評論
發(fā)表評論
正在加載評論......
返回頂部發(fā)表評論
呢 稱:
表 情:
內(nèi) 容:
評論內(nèi)容:不能超過 1000 字,需審核,請自覺遵守互聯(lián)網(wǎng)相關(guān)政策法規(guī)。
驗證碼: 驗證碼 
網(wǎng)友評論聲明,請自覺遵守互聯(lián)網(wǎng)相關(guān)政策法規(guī)。

您發(fā)布的評論即表示同意遵守以下條款:
一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家、社會、集體和公民的合法權(quán)益;
二、不得發(fā)布國家法律、法規(guī)明令禁止的內(nèi)容;互相尊重,對自己在本站的言論和行為負責(zé);
三、本站對您所發(fā)布內(nèi)容擁有處置權(quán)。

更多信息>>欄目類別選擇
百度小程序開發(fā)
微信小程序開發(fā)
微信公眾號開發(fā)
uni-app
asp函數(shù)庫
ASP
DIV+CSS
HTML
python
更多>>同類信息
ASP中Utf-8與Gb2312編碼轉(zhuǎn)換亂碼問題的解決方法頁面編碼聲明
asp顯示隨機密碼
通過阿里云服務(wù)接口獲得ip地址詳細信息
iis點開后任務(wù)欄上有顯示,但是窗口看不到的解決辦法
RSA加密解密插件
微軟Encoder加密解密函數(shù)
更多>>最新添加文章
dw里面查找替換使用正則刪除sqlserver里面的CONSTRAINT
Android移動端自動化測試:使用UIAutomatorViewer與Selenium定位元素
抖音直播音掛載小雪花 懂車帝小程序
javascript獲取瀏覽器指紋可以用來做投票
火狐Mozilla Firefox出現(xiàn):無法載入您的Firefox配置文件 它可能已經(jīng)丟失 或是無法訪問 問題解決集合處理辦法
在Android、iOS、Windows、MacOS中微信小程序的文件存放路徑
python通過代碼修改pip下載源讓下載庫飛起
python里面requests.post返回的res.text還有其它的嗎
更多>>隨機抽取信息
window7簡稱win7下可以運行ASP文件,但是不能訪問access數(shù)據(jù)庫的解決辦法
利用CSS讓網(wǎng)頁里的提交按鈕變得更漂亮
按鈕復(fù)制文章URL和復(fù)制保留文章的版權(quán)
深山留言板v4.8 - 5.13母親節(jié)模板
另外一種符合web2.0的鏈接打開方式--利用base打開鏈接
利用正則替換生成html,經(jīng)典的,可以用數(shù)組進行替換
主站蜘蛛池模板: 日韩欧美中文字幕一区 | 在线国产视频一区 | 欧美精品在线一区二区三区 | 欧美大胆a视频 | 性满足久久久久久久久 | 在线观看精品视频网站www | 色成人综合 | 日韩经典一区 | 欧美亚洲激情在线 | 日韩视频在线观看一区 | 五月六月伊人狠狠丁香网 | 亚洲精品国产成人 | 久久99精品久久久久子伦小说 | 91网站在线看 | https黄视 | 国产精品久久久久久久久免费观看 | 污污成人一区二区三区四区 | 日本久久久久亚洲中字幕 | 香蕉视频免费在线观看 | 欧美一级视频免费观看 | 欧美第四页 | 亚洲色图男人天堂 | 久久久久久一级毛片免费野外 | 亚洲一区二区视频 | 一区二区三区高清 | 5151四虎永久在线精品免费 | 狠狠色婷婷 | 日本视频免费观看 | 在线免费观看一区二区三区 | 91国语精品3p在线观看 | 天天搞天天操 | 欧美性色xo影院永久禁欲 | 亚洲一色 | 亚洲一区二区三区精品视频 | 欧美性xxxx | 四虎亚洲国产成人久久精品 | 五月天在线免费视频 | 国产在线原创剧情麻豆 | 1204曰韩欧美成人看片 | 色婷婷综合缴情综六月 | 岛国在线123456|