jhengfei
          愛JAVA,愛生活

          因了需要用到這些信息,所以總結(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)滴鑄就輝煌 閱讀(1089) 評論(0)  編輯  收藏 所屬分類: 技術(shù)點(diǎn)滴
           
          主站蜘蛛池模板: 河源市| 洞头县| 于田县| 临沭县| 西宁市| 阳原县| 阿图什市| 墨脱县| 阜阳市| 湛江市| 上栗县| 陕西省| 武功县| 涿鹿县| 克山县| 九江市| 富裕县| 余姚市| 海安县| 桐庐县| 城市| 门源| 西贡区| 香港 | 西和县| 文山县| 小金县| 望谟县| 丘北县| 韶山市| 乾安县| 运城市| 贵州省| 宿松县| 江孜县| 灵石县| 当阳市| 大竹县| 卓尼县| 威海市| 日喀则市|