| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 506 人关注过本帖
标题:获取环境变量的问题
只看楼主 加入收藏
话真尘
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2010-5-21
结帖率:75%
收藏
已结贴  问题点数:10 回复次数:1 
获取环境变量的问题
<body>
<%
function system(text)
 if instr(text,"nt 5.2")>0 then
  system="windows 2003"
  elseif instr(text,"nt 5.1")>0 then
  system="windows xp"
   elseif instr(text,"nt 5")>0 then
   system="windows 2000"
    elseif instr(text,"nt 4")>0 then
    system="windows nt4"
     elseif instr(text,"nt 4.9")>0 then
     system="windows 4.9"
      elseif instr(text,"nt me")>0 then
      system="windows me"
       elseif instr(text,"nt 98")>0 then
       system="windows 98"
        elseif instr(text,"nt 95")>0 then
        system="windows 95"
        else
        system="未知"
    end  if   
end function   
function  browser (text)
   if  instr(text,"MSIE6.0")>0  then
     browser ="internet Ezplorer 6.0"
    elseif  instr(text,"MSIE5.5")>0  then
     browser ="internet Ezplorer 5.5"
    elseif  instr(text,"MSIE5.01")>0  then
     browser ="internet Ezplorer 5.01"
    elseif  instr(text,"MSIE5.0")>0  then
     browser ="internet Ezplorer 5.0"
    elseif  instr(text,"MSIE4.0")>0  then
     browser ="internet Ezplorer 4.0"
    else  browser="unknown"
   end  if
end  function
ip=request.ServerVariables("remote addr")
os ie=request.ServerVariables("http user agent")        
os=system(os ie)
ie=browser(os ie)
iip array=split(ip,".")
iip=iip array(0)&"."&iip array(1)&"."&iip array(2)&".*"
ip=mid(ip,1,instrrev(ip,"."))&"*"
response.write"访问者的ip:"&ip&"<br>"
response.write"访问者的机器环境:"&os ie&"<br>"
response.write"访问者的炒作系统:"&os&"<br>"
response.write"访问者的浏览器型号"&ie&"<br>"
%>   
</body>
</html>

这个有什么问题啊?
搜索更多相关主题的帖子: 环境变量 获取 
2010-06-01 20:06
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:7 
      <select name="UsSystem" style="width:465px ">
      <%
        Function UsBrowser(info)
            Dim browser
            browser=""
            IF Instr(info,"NetCaptor 6.5.0")>0 Then
               browser="浏览器:NetCaptor 6.5.0"
            End IF
            IF Instr(info,"MyIe 3.1")>0 Then
               browser="浏览器:MyIe 3.1"
            End IF
            IF Instr(info,"NetCaptor 6.5.0RC1")>0 Then
               browser="浏览器:NetCaptor 6.5.0RC1"
            End IF
            IF Instr(info,"NetCaptor 6.5.PB1")>0 Then
               browser="浏览器:NetCaptor 6.5.PB1"
            End IF
            IF Instr(info,"MSIE 5.5")>0 Then
               browser="浏览器:Internet Explorer 5.5"
            End IF
            IF Instr(info,"MSIE 6.0")>0 Then
               browser="浏览器:Internet Explorer 6.0"
            End IF
            IF Instr(info,"MSIE 6.0b")>0 Then
               browser="浏览器:Internet Explorer 6.0b"
            End IF
            IF Instr(info,"MSIE 5.01")>0 Then
               browser="浏览器:Internet Explorer 5.01"
            End IF
            IF Instr(info,"MSIE 5.0")>0 Then
               browser="浏览器:Internet Explorer 5.00"
            End IF
            IF Instr(info,"MSIE 4.0")>0 Then
               browser="浏览器:Internet Explorer 4.01"
            End IF
            IF browser="" Then
               browser="浏览器:未知"
            End IF
            UsBrowser=browser
        End Function
        Function UsSystem(info)
            Dim system
            system=""
            If Instr(info,"NT 5.1")>0 Then
               system=system+"操作系统:Windows XP"
            End IF
            IF Instr(info,"Tel")>0 Then
               system=system+"操作系统:Telport"
            End IF
            IF Instr(info,"webzip")>0 Then
               system=system+"操作系统:webzip"
            End IF
            IF Instr(info,"flashget")>0 Then
               system=system+"操作系统:flashget"
            End IF
            IF Instr(info,"offline")>0 Then
               system=system+"操作系统:offline"
            End IF
            IF Instr(info,"NT 5")>0 then
               system=system+"操作系统:Windows 2000"
            End IF
            IF Instr(info,"NT 4")>0 Then
               system=system+"操作系统:Windows NT 4.0"
            End IF
            IF Instr(info,"98")>0 Then
               system=system+"操作系统:Windows 98"
            End IF
            IF Instr(info,"95")>0 Then
               system=system+"操作系统:Windows 95"
            End If
            IF Instr(info,"NT 5.1")>0 Then
               system=system+"操作系统:Windows XP"
            End IF
            IF Instr(info,"NT 5.2")>0 Then
               system=system+"操作系统:Windows SERVER 2003"
            End IF
            IF system="" Then
               system=system+"操作系统:未知"
            End IF
            UsSystem=system
        End Function
        Response.Write "<option selected>"&UsBrowser(Request.ServerVariables("HTTP_USER_AGENT"))&"</option>"&Chr(13)
        Response.Write "<option>IP地址:"&Request.ServerVariables("REMOTE_ADDR")&"</option>"&Chr(13)
        Response.Write "<option>"&UsSystem(Request.ServerVariables("HTTP_USER_AGENT"))&"</option>"&Chr(13)
        'Response.Write "<option>CPU型号:"&Request.ServerVariables("HTTP_UA_CPU")&"</option>"&Chr(13)
        'Response.Write "<option>显示器分辨率:"&Request.ServerVariables("HTTP_UA_PIXELS")&"</option>"&Chr(13)
      %>
      </select>
以前写的给楼主参考
2010-06-01 22:56
快速回复:获取环境变量的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025160 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved