브라우저의 종류와 버전, 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 198건 8 페이지
  • RSS
기술자료 목록
58
ClassicASP   15168  2008-08-02 18:01  
57
ClassicASP   36008  2008-07-16 16:44  
56
ClassicASP   12935  2008-07-10 13:38  
55
ClassicASP   12122  2008-07-01 18:28  
54
ClassicASP   12628  2008-06-23 19:58  
53
ClassicASP   11950  2008-06-23 19:54 ~ 2008-08-02 00:00  
52
ClassicASP   16926  2008-06-23 19:46 ~ 2016-10-21 00:00  
51
ClassicASP   20345  2008-06-23 19:37  
50
ClassicASP   23227  2008-06-23 19:31 ~ 2008-05-27 00:00  
49
ClassicASP   18248  2008-06-23 19:22 ~ 2009-11-11 00:00  
열람
ClassicASP   20666  2008-06-19 21:59 ~ 2018-12-01 22:44  
47
ClassicASP   17711  2008-06-14 19:57  
46
ClassicASP   14003  2008-06-11 09:54 ~ 2009-07-20 00:00  
45
ClassicASP   12563  2008-06-10 19:47 ~ 2009-10-26 00:00  
44
ClassicASP   15382  2008-05-29 22:14  
43
ClassicASP   15501  2008-05-23 23:29  
42
ClassicASP   21957  2008-05-23 23:14 ~ 2016-01-23 00:00  
41
ClassicASP   10077  2008-05-20 19:10  
40
ClassicASP   25423  2008-05-04 09:58  
39
ClassicASP   12544  2008-04-26 15:38  

검색

해피정닷컴 정보

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

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