브라우저의 종류와 버전, OS 알아내기 > 기술자료 | 해피정닷컴

브라우저의 종류와 버전, OS 알아내기 > 기술자료

본문 바로가기

사이트 내 전체검색

브라우저의 종류와 버전, OS 알아내기 > 기술자료

ClassicASP 브라우저의 종류와 버전, OS 알아내기

페이지 정보


본문

<%
Dim hpStrUserAgent,hpAgentDevice,hpSwfCheck
'Request.ServerVariables("HTTP_USER_AGENT") ' 접속자의 에이젼트 정보를 얻는함수
hpStrUserAgent = Request.ServerVariables("HTTP_USER_AGENT")
'if request.ServerVariables("REMOTE_ADDR") = "내컴퓨터아이피" then ?' 내컴퓨터아이피찾기 ?http://ipconfig.co.kr
'  response.write "hpStrUserAgent = "& hpStrUserAgent &"<br>"
'end if


If InStr(hpStrUserAgent,"Edge") > 0 then
  hpAgentBrowser = "Edge"
elseIf InStr(hpStrUserAgent,"rv:11.0") > 0 then
  hpAgentBrowser = "IE11"
elseIf InStr(hpStrUserAgent,"MSIE 10") > 0 then
  hpAgentBrowser = "IE10"
elseIf InStr(hpStrUserAgent,"MSIE 9") > 0 then
  hpAgentBrowser = "IE9"
elseIf InStr(hpStrUserAgent,"MSIE 8") > 0 then
  hpAgentBrowser = "IE8"
elseIf InStr(hpStrUserAgent,"MSIE 7") > 0 then
  hpAgentBrowser = "IE7"
elseIf InStr(hpStrUserAgent,"MSIE 6") > 0 then
  hpAgentBrowser = "IE6"
elseIf InStr(hpStrUserAgent,"Opera") > 0 or InStr(hpStrUserAgent,"OPERA") > 0 or InStr(hpStrUserAgent,"OPR") > 0 then
  hpAgentBrowser = "Opera"
elseIf InStr(hpStrUserAgent,"Firefox") > 0 or InStr(hpStrUserAgent,"FIREFOX") > 0 then
  hpAgentBrowser = "Firefox"
elseIf InStr(hpStrUserAgent,"KAKAOTALK") > 0 then
  hpAgentBrowser = "KakaoTalk"
elseIf InStr(hpStrUserAgent,"NAVER") > 0 then
  hpAgentBrowser = "Naver"
elseIf InStr(hpStrUserAgent,"FBAN") > 0 or InStr(hpStrUserAgent,"FBAV") > 0 or InStr(hpStrUserAgent,"FBBV") > 0 or InStr(hpStrUserAgent,"FBRV") > 0 or InStr(hpStrUserAgent,"FBDV") > 0 or InStr(hpStrUserAgent,"FBMD") > 0 or InStr(hpStrUserAgent,"FBSN") > 0 or InStr(hpStrUserAgent,"FBSV") > 0 or InStr(hpStrUserAgent,"FBSS") > 0 or InStr(hpStrUserAgent,"FBCR") > 0 or InStr(hpStrUserAgent,"FBID") > 0 or InStr(hpStrUserAgent,"FBLC") > 0 or InStr(hpStrUserAgent,"FBOP") > 0 then
  hpAgentBrowser = "Facebook"
elseIf InStr(hpStrUserAgent,"Chrome") > 0 or InStr(hpStrUserAgent,"CriOS") > 0 then
  hpAgentBrowser = "Chrome"
elseIf InStr(hpStrUserAgent,"Android") > 0 or InStr(hpStrUserAgent,"ANDROID") > 0 then
  hpAgentBrowser = "Android"
elseIf InStr(hpStrUserAgent,"Safari") > 0 or InStr(hpStrUserAgent,"SAFARI") > 0 then
  hpAgentBrowser = "Safari"
else
  hpAgentBrowser = "ETC"
end if


If InStr(hpStrUserAgent,"Android") > 0 then
  hpAgentDevice = "Android"
elseIf InStr(hpStrUserAgent,"iPhone") > 0 then
  hpAgentDevice = "iPhone"
elseIf InStr(hpStrUserAgent,"iPad") > 0 then
  hpAgentDevice = "iPad"
elseIf InStr(hpStrUserAgent,"iPod") > 0 then
  hpAgentDevice = "iPod"
elseIf InStr(hpStrUserAgent,"Macintosh") > 0 then
  hpAgentDevice = "Macintosh"
elseIf InStr(hpStrUserAgent,"SymbianOS") > 0 then
  hpAgentDevice = "SymbianOS"
elseIf InStr(hpStrUserAgent,"BlackBerry") > 0 then
  hpAgentDevice = "BlackBerry"
elseIf InStr(hpStrUserAgent,"BB10") > 0 then
  hpAgentDevice = "BB10"
elseIf InStr(hpStrUserAgent,"Nokia") > 0 then
  hpAgentDevice = "Nokia"
elseIf InStr(hpStrUserAgent,"SonyEricsson") > 0 then
  hpAgentDevice = "SonyEricsson"
elseIf InStr(hpStrUserAgent,"webOS") > 0 then
  hpAgentDevice = "webOS"
elseIf InStr(hpStrUserAgent,"PalmOS") > 0 then
  hpAgentDevice = "PalmOS"
elseIf InStr(hpStrUserAgent,"LINUX") > 0 or InStr(hpStrUserAgent,"Linux") > 0 then
  hpAgentDevice = "Linux"
elseIf InStr(hpStrUserAgent,"Windows") > 0 then
  hpAgentDevice = "Windows"
else
  hpAgentDevice = "ETC"
end if


if hpAgentBrowser="IE6" or hpAgentBrowser="IE7" or hpAgentBrowser="IE8" or hpAgentBrowser="IE9" or hpAgentBrowser="IE10" or hpAgentBrowser="IE11" or hpAgentBrowser="Chrome" then
  hpSwfCheck=0 ' flash 사용가능
else
  hpSwfCheck=1
end if


dim hpRemoteIP
hpRemoteIP = request.ServerVariables("REMOTE_ADDR")

response.write "<br><br>"
response.write "UserAgent = "& hpStrUserAgent &"<br><br>"
response.write "Browser = "& hpAgentBrowser &"<br><br>"
'response.write "Flash = "& hpSwfCheck &"<br><br>"
response.write "OS = "& hpAgentDevice &"<br><br>"
%>


브라우저 Agent 정보
https://www.happyjung.com/bbs/board.php?bo_table=lecture&wr_id=2179  참고


플래시 IE 11 이후 일때 대응하기
안드로이드 기기, 애플 및 IE 11 에서는 object 를 이용한 플래시를 표시하지 않는 경우가 있음
이때는 embed를 이용하면 표현이 되므로, 아래와 같이 적용하면 해결가능합니다.
<%
if hpSwfCheck=1 then
 %><object type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="682" height="65" title="메뉴">
  <param name="movie" value="menu.swf" />
  <param name="quality" value="high" />
  <param name="wmode" value="transparent" /></object><%
else
%><embed src="menu.swf" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="682" height="65"></embed><%
end if
%>



참고자료
http://dojeun.egloos.com/318090

댓글목록

등록된 댓글이 없습니다.


Total 2,641건 107 페이지
  • RSS
기술자료 목록
521
Secure   13428  2008-06-25 12:20  
520
MSSQL   19607  2008-06-25 10:26  
519
그누보드   23337  2008-06-24 22:11  
518
HTML   16124  2008-05-09 11:13  
517
ClassicASP   12609  2008-06-23 19:58  
516
ClassicASP   11925  2008-06-23 19:54 ~ 2008-08-02 00:00  
515
ClassicASP   16904  2008-06-23 19:46 ~ 2016-10-21 00:00  
514
ClassicASP   20327  2008-06-23 19:37  
513
ClassicASP   23207  2008-06-23 19:31 ~ 2008-05-27 00:00  
512
ClassicASP   18221  2008-06-23 19:22 ~ 2009-11-11 00:00  
511
그누보드   10264  2008-06-21 21:34  
510
그누보드   13350  2008-06-21 19:44  
509
HTML   28477  2008-06-21 18:30 ~ 2008-06-21 00:00  
508
PHP   14012  2008-06-21 18:14  
열람
ClassicASP   20649  2008-06-19 21:59 ~ 2018-12-01 22:44  
506
일반   12540  2008-06-19 09:05  
505
ClassicASP   17687  2008-06-14 19:57  
504
영카트   12044  2008-06-12 16:08  
503
Linux   20886  2008-06-12 09:21 ~ 2010-02-27 00:00  
502
그누보드   13654  2008-06-11 15:36  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2024 해피정닷컴. All Rights Reserved.