菜鸟问题,急,在线等

BeckLikeCoding 2010-08-31 04:16:52
谁给我解释下
Request.ServerVariables("HTTP_USER_AGENT")


返回的是什么


UserAgent =Request.ServerVariables("HTTP_USER_AGENT").Item(1);

报 数组越界的错

应该怎么判断?

...全文
95 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
BeckLikeCoding 2010-08-31
  • 打赏
  • 举报
回复
没人了啊?
BeckLikeCoding 2010-08-31
  • 打赏
  • 举报
回复
没值应该怎么判断啊?
没接触过asp,部知道基本的函数


Request.ServerVariables("HTTP_USER_AGENT").Item.lenth() 吗 ?

还有这个 Request.ServerVariables("HTTP_USER_AGENT").Item(1)是什么意思
和Request.ServerVariables("HTTP_USER_AGENT")有什么区别啊?
lzp4881 2010-08-31
  • 打赏
  • 举报
回复
使用Request.Servervariables("HTTP_USER_AGENT")取操作系统编号和浏览器版本号,配合split函数将字符串分成数组,再使用replace函数将数组内的部份字符串进行了替换。

1strsplit=split(Request.Servervariables("HTTP_USER_AGENT"),";")
2strsplit(1)=replace(strsplit(1),"MSIE","Internet Explorer")
3strsplit(2)=replace(strsplit(2),"NT 5.1","XP")
4strsplit(2)=replace(strsplit(2),"NT 5.0","2000")
5strsplit(1)=Trim(strsplit(1))
6strsplit(2)=Trim(strsplit(2))
马老虎 2010-08-31
  • 打赏
  • 举报
回复
[Quote=引用楼主 beckapi 的回复:]
谁给我解释下
Request.ServerVariables("HTTP_USER_AGENT")


返回的是什么


UserAgent =Request.ServerVariables("HTTP_USER_AGENT").Item(1);

报 数组越界的错

应该怎么判断?
[/Quote]
没值吧!
avajuohz 2010-08-31
  • 打赏
  • 举报
回复
Request.ServerVariables("HTTP_USER_AGENT").Item 明显没有值嘛
挨踢直男 2010-08-31
  • 打赏
  • 举报
回复
不好意思
当成.net的问题看了
挨踢直男 2010-08-31
  • 打赏
  • 举报
回复
Request.ServerVariables["HTTP_USER_AGENT"]

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧