数码资讯
判断浏览器版本通过代理保存共享
复制代码代码如下所示: 字符串(字符串getbrowser UserAgent){ 如果(UserAgent = = null | | useragent.trim()。长度()<1){ 返回未知; } brorseren =新的字符串字符串{ } { } { MYIE2 火狐 kuosoft lb
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
复制代码代码如下所示:
字符串(字符串getbrowser UserAgent){
如果(UserAgent = = null | | useragent.trim()。长度()<1){
返回未知;
}
brorseren =新的字符串字符串{ } { } {
MYIE2
火狐
kuosoft
lbbrowser
世界
QQ
傲游
biduplayerbrowser
歌剧
铬
Safari
9a334
UCWEB
oglebot
RV 11};
brorsercn =新的字符串字符串{ } { } {
MYIE2
火狐
酷狗
猎豹
世界之窗
QQ
傲游
百度视频
歌剧
铬
Safari
360
UCWEB
oglebot
ie 11};
为(int i = 0;i < brorseren.length;i++){
如果(useragent.indexof(brorseren {我})> 1){
返回brorsercn {我};
}
}
如果(useragent.indexof(MSIE)> 1){
如果(useragent.indexof(MSIE 9 )> 1){
返回ie 9;
} else if(useragent.indexof(MSIE 10 )> 1){
返回ie 10;
} else if(useragent.indexof(MSIE 8 )> 1){
返回ie 8;
} else if(useragent.indexof(MSIE 7 )> 1){
返回ie 7;
} else if(useragent.indexof(MSIE 6 )> 1){
返回ie 6;
}
返回ie;
}
返回未知的浏览器;
}
字符串(字符串getbrowser UserAgent){
如果(UserAgent = = null | | useragent.trim()。长度()<1){
返回未知;
}
brorseren =新的字符串字符串{ } { } {
MYIE2
火狐
kuosoft
lbbrowser
世界
傲游
biduplayerbrowser
歌剧
铬
Safari
9a334
UCWEB
oglebot
RV 11};
brorsercn =新的字符串字符串{ } { } {
MYIE2
火狐
酷狗
猎豹
世界之窗
傲游
百度视频
歌剧
铬
Safari
360
UCWEB
oglebot
ie 11};
为(int i = 0;i < brorseren.length;i++){
如果(useragent.indexof(brorseren {我})> 1){
返回brorsercn {我};
}
}
如果(useragent.indexof(MSIE)> 1){
如果(useragent.indexof(MSIE 9 )> 1){
返回ie 9;
} else if(useragent.indexof(MSIE 10 )> 1){
返回ie 10;
} else if(useragent.indexof(MSIE 8 )> 1){
返回ie 8;
} else if(useragent.indexof(MSIE 7 )> 1){
返回ie 7;
} else if(useragent.indexof(MSIE 6 )> 1){
返回ie 6;
}
返回ie;
}
返回未知的浏览器;
}
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。