最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
怎样用asp来判断客户端浏览器和操作系统的类型。
时间:2022-07-02 23:51:56 编辑:袖梨 来源:一聚教程网
很多人都在问这个问题阿,下面就是答案了:)
-----------------------------------------
首先她要用到asp的ServerVarialbles这个集合。在ServerVarialbles有这样一项HTTP_USER_AGENT,他有什么作用呢?他的作用就是获取客户端浏览器的基本信息和的版本阿,如是什么牌子的浏览器阿(一般就是IE和netscape了),他们的版本号什么的,下面我用一个程序来说明她的用法,文件命名为CheckBrowse.asp。
$U2 Forum rautinee原创$
$http://u2bbs.*1**26.com$
'++++++++++++++以下是程序的正文+++++++++++++++++
>
Dim BrowseMsg,BrowseVersion,SystemVersion
BrowseMsg=Request.ServerVariables("HTTP_USER_AGENT")
'+++++++++++一个基本判别操作系统的函数+++++++++++
Function SystemCheck()
if inStr(BrowseMsg,"Windows 98") then
SystemCheck="Windows 98"
else if inStr(BrowseMsg,"Windows NT 4.0") then
SystemCheck="Windows NT 4.0"
else if inStr(BrowseMsg,"Windows NT 5.0") then
SystemCheck="Windows NT 2000"
else
SystemCheck="未知类型"
end if
end if
end if
end Function
'由于时间的原因我没有写判定win95和windows xp的语句,感兴趣的网友可以
'自行添加:)
'+++++++++++结束+++++++++++
if inStr(BrowseMsg,"MSIE") then
SystemVersion=CInt(Mid(BrowseMsg,inStr(BrowseMsg,"MSIE")+5,1))
response.write "您的浏览器的版本是 IE"&BrowseVersion&"
"
response.write "您的操作系统是 "&SystemCheck()
end if
%>
----------------------------------------
ok,enjoy it and good luck!
相关文章
- Yandex网页版访问入口 Yandex搜索引擎官网登录 10-26
- AI漫剧伪装直男1‑24集无雾版夸克网盘资源免费分享 10-26
- 韩漫在线免费漫画入口-最新韩漫免费阅读入口 10-26
- 海角社区最新登录入口-2026海角官网在线登录直达地址 10-26
- mcjs网页版即点即玩-mcjs极速秒玩入口 10-23
- 超星学习通网页版登录-超星学习通官网入口 10-23