網頁設計HTTP_USER_AGENT (User Agent) 作業系統及瀏覽器類型

Retrieving HTTP Headers with ASP

使用 ASP 內建 Request 物件,取得伺服器的設定和用戶端的使用環境 Request.ServerVariables 包含伺服器環境變數的值,環境變數涵蓋用戶端和伺服器端的各種資訊 (瀏覽器識別資料)。

Request.ServerVariables("REMOTE_ADDR") 用戶真實 IP
Request.ServerVariables("HTTP_USER_AGENT") 取得用戶端的使用環境
Request.ServerVariables("HTTP_ACCEPT")
Request.ServerVariables("HTTP_ACCEPT_CHARSET")
Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") 用戶端語系環境





Internet Explorer

Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
text/html, application/xhtml+xml, */*
-
zh-tw
  • MSIE 10.0; Windows NT 6.2; WOW64; Windows 8, MSIE 10.0
  • MSIE 9.0; Windows NT 6.1; WOW64; Windows 7, MSIE 9.0
  • MSIE 8.0; Windows NT 6.0; Windows Vista, MSIE 8.0
  • MSIE 8.0; Windows NT 5.2; Windows 2003, MSIE 8.0
  • MSIE 8.0; Windows NT 5.1; Windows XP, MSIE 8.0
  • MSIE 7.0; Windows NT 5.0; Windows 2000, MSIE 7.0


Chrome

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
-
zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4,ja;q=0.2
  • Chrome/23.0.1271.64 Safari/537.11 Chrome 23
  • Chrome/22.0.1229.94 Safari/537.4 Chrome 22
  • Chrome/21.0.1180.89 Safari/537.1 Chrome 21
  • Chrome/18.0.966.0 Safari/535.12 Chrome 18


Firefox

Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
-
zh-tw,en-us;q=0.7,en;q=0.3
  • (Windows NT 6.1; rv:16.0) Gecko/20100101 Firefox/15.0 Windows 7, Firefox 15
  • (X11; Ubuntu; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1 Linux i686, Firefox 14
  • (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0 OS X Lion, Firefox 11


Safari

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
-
zh-TW
  • Macintosh; Intel Mac OS X 10_7_4 Version/5.1.7 Safari/534.57.2 OS X Mountain-Lion, Safari 5.1.7
  • Macintosh; Intel Mac OS X 10_7_2 Version/5.1.5 Safari/534.55.3 OS X Lion, Safari 5.1.5
  • Macintosh; Intel Mac OS X 10_6_8 Version/5.1.2 Safari/534.52.7 OS X Snow Leopard, Safari 5.1.2
  • Macintosh; Intel Mac OS X 10_5_8 Version/5.0.6 Safari/533.22.3 OS X Leopard, Safari 5.0.6
  • iPad; CPU OS 6_0_1 like Mac OS X iPad iOS 6.0.1
  • iPad; CPU OS 5_1_1 like Mac OS X iPad iOS 5.1.1
  • iPhone; CPU iPhone OS 6_0 like Mac OS X iPhone iOS 6.0
  • iPhone; CPU iPhone OS 5_0_1 like Mac OS X iPhone iOS 5.0.1
  • iPhone; U; CPU iPhone OS 4_1 like Mac OS X iPhone iOS 4.1


Opera

Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.17
text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
-
zh-TW,zh;q=0.9,en;q=0.8
  • (Android; Opera Mini/7.0.29952/28.1857; U; zh) Presto/2.8.119 Version/11.10 Android, Opera Mini
  • (iPad; Opera Mini/7.1.32694/27.1662; U; zh) Presto/2.8.119 Version/11.10 iPad, Opera Mini
  • (iPhone; Opera Mini/7.0.4/28.2725; U; zh) Presto/2.8.119 Version/11.10 iPhone, Opera Mini
  • (Windows NT 6.1; WOW64; U; zh-tw) Presto/2.10.289 Version/12.02 Windows 7, Opera 12.02

Modification in