jhengfei
          愛JAVA,愛生活

          導(dǎo)航

          <2006年10月>
          24252627282930
          1234567
          891011121314
          15161718192021
          22232425262728
          2930311234
          統(tǒng)計(jì)
          • 隨筆 - 37
          • 文章 - 0
          • 評論 - 5
          • 引用 - 0

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          收藏夾

          java網(wǎng)址

          別處看到的BLOG

          牛人怪客

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

           

          因了需要用到這些信息,所以總結(jié)一下,方便以后參閱
          通過request.getHeader("User-Agent")大致可以取得用戶瀏覽器的信息
          如果里面包含:
          "msie"-->MicroSoft?
          "opera" -->Opera Software
          "mozilla"-->Netscape Communications

          如果取瀏覽器版本信息
          String str = request.getHeader("User-Agent");
          MS :? str.substring(str.indexOf("msie") + 5);
          Other :
          tmpString = (str.substring(tmpPos = (str.indexOf("/")) + 1, tmpPos + str.indexOf(" "))).trim(); ?//沒有親自試

          操作系統(tǒng)部分,不啰嗦了
          private void setOs()
          {
          if (this.userAgent.indexOf("win") > -1){
          ? if (this.userAgent.indexOf("windows 95") > -1 || this.userAgent.indexOf("win95") > -1){
          ???? this.os = "Windows 95";
          ? }
          ? if (this.userAgent.indexOf("windows 98") > -1 || this.userAgent.indexOf("win98") > -1){
          ???? this.os = "Windows 98";
          ? }
          ? if (this.userAgent.indexOf("windows nt") > -1 || this.userAgent.indexOf("winnt") > -1){
          ????? this.os = "Windows NT";
          ? }
          ? if (this.userAgent.indexOf("win16") > -1 || this.userAgent.indexOf("windows 3.") > -1){
          ????? this.os = "Windows 3.x";
          ? }
          ?}
          }

          獲取語言request.getHeader("Accept-Language");

          詳細(xì)信息可以再分解....

          posted on 2006-10-24 10:25 點(diǎn)滴鑄就輝煌 閱讀(1093) 評論(0)  編輯  收藏 所屬分類: 技術(shù)點(diǎn)滴
           
          主站蜘蛛池模板: 湖南省| 红原县| 潞西市| 三河市| 南漳县| 南皮县| 陕西省| 宣城市| 杭锦旗| 白水县| 额济纳旗| 陆河县| 都匀市| 鸡东县| 虹口区| 南通市| 邳州市| 鄂温| 安塞县| 萨迦县| 布拖县| 永丰县| 东乌珠穆沁旗| 民县| 青州市| 望奎县| 雷山县| 洪洞县| 皮山县| 玉环县| 武清区| 闵行区| 江北区| 哈尔滨市| 威信县| 西贡区| 安达市| 永修县| 颍上县| 简阳市| 万宁市|