注册 | 登录 | 设为首页 | 加入收藏
您当前的位置:飞翔学院-IT中国 → 编程开发Asp → 文章内容

Request.ServerVariables参数

作者:佚名 来源:本站整理 发布时间:2007-10-25 10:53:44

一,获得网页来访者IP地址的代码是:

您的IP是: <% =Request.ServerVariables("REMOTE_ADDR") %>

二,获得操作系统版本的代码是:

<% response.Write operationsystem & "<br>" & browser
function operationsystem() '操作系统版本
agent = Request.ServerVariables("HTTP_USER_AGENT")
if Instr(agent,"NT 5.2")>0 then
SystemVer="Windows Server 2003"
elseif Instr(agent,"NT 5.1")>0 then
SystemVer="Windows XP"
elseif Instr(agent,"NT 5")>0 then
SystemVer="Windows 2000"
elseif Instr(agent,"NT 4")>0 then
SystemVer="Windows NT4"
elseif Instr(agent,"4.9")>0 then
SystemVer="Windows ME"
elseif Instr(agent,"98")>0 then
SystemVer="Windows 98"
elseif Instr(agent,"95")>0 then
SystemVer="Windows 95"

else
SystemVer="未知"
end if
operationsystem="您的操作系统是: " & SystemVer
end function %>


三,获得浏览器版本的代码是:

<% function browser() '浏览器版本
agent = Request.ServerVariables("HTTP_USER_AGENT")
if Instr(agent,"MSIE 6.0")>0 then
browserVer="Internet Explorer 6.0"
elseif Instr(agent,"MSIE 5.5")>0 then
browserVer="Internet Explorer 5.5"
elseif Instr(agent,"MSIE 5.01")>0 then
browserVer="Internet Explorer 5.01"
elseif Instr(agent,"MSIE 5.0")>0 then
browserVer="Internet Explorer 5.00"
elseif Instr(agent,"MSIE 4.0")>0 then
browserVer="Internet Explorer 4.0"
else
browserVer="未知"
end if
browser="您的浏览器版本: " & browserVer
if Instr(agent,"TencentTraveler")>0 then '检查是否正在使用腾讯TT
browser=browser&" |目前正使用TencentTraveler"
end if
end function %>

  • 打印文档
  • 推荐好友
  • 返回顶部
  • 增大字体
  • 减少字体
关于本站 | 工作机会 | 合作网站 | 广告服务 | 市场合作| 联系我们 | 抽奖活动
版权所有: 武汉威俊科技有限公司 Copyright 2005-2007 www.ITCNW.COM All rights reserved