捌玖网络工作室's Archiver

tianya 发表于 2008-4-29 12:52

获得网页来访者IP地址的代码

一,获得网页来访者IP地址的代码是:[code]您的IP是: <% =Request.ServerVariables("REMOTE_ADDR") %> [/code]二,获得操作系统版本的代码是:[code]<% response.Write operationsystem & "<br>" & browser
&~5lz.}3Q7Y function operationsystem() '操作系统版本 JR(xH1Q
agent = Request.ServerVariables("HTTP_USER_AGENT") h/m|v/Z"ZD"P
if Instr(agent,"NT 5.2")>0 then
k)G6N ?*} SystemVer="Windows Server 2003" %Ng3Oy4j:w$k?k1d
elseif Instr(agent,"NT 5.1")>0 then
1B)q l6Lr A@ SystemVer="Windows XP" "Dlw @%mJY$?
elseif Instr(agent,"NT 5")>0 then
9g*w_KQ!a-u| Xi SystemVer="Windows 2000" sIc}+po ?'l|
elseif Instr(agent,"NT 4")>0 then 3[S(_H9~Ozt
SystemVer="Windows NT4"
9Gn{j6u#U_"P elseif Instr(agent,"4.9")>0 then
-}Q#_t{} SystemVer="Windows ME" m&dE)K8D'P)U
elseif Instr(agent,"98")>0 then
%pt;f5X N^Sfj SystemVer="Windows 98"
X5u M/]:RtS elseif Instr(agent,"95")>0 then
xyl,GB#_ SystemVer="Windows 95" E4J\#mYN/w
i-[1l.]`l(C
else
uU8rp,V-Z s&b SystemVer="未知"
3uT9qfm;e*b end if
quC,yBP%J operationsystem="您的操作系统是: " & SystemVer
6u7q"_o j%K end function %> 4f g g"[%h$Hq
[/code]三,获得浏览器版本的代码是:[code]<% function browser() '浏览器版本 MF u2]+Q"x
agent = Request.ServerVariables("HTTP_USER_AGENT")
G"n,~x)i kM if Instr(agent,"MSIE 6.0")>0 then 'XOwY N&h!o
browserVer="Internet Explorer 6.0"
ej ~d6`4N4]|!gaF elseif Instr(agent,"MSIE 5.5")>0 then
"^gm;[S6_%b `M+l@ browserVer="Internet Explorer 5.5"
T0cGF1m elseif Instr(agent,"MSIE 5.01")>0 then )L7H JH,kPe$a
browserVer="Internet Explorer 5.01"
;o-s!@7W?W3o elseif Instr(agent,"MSIE 5.0")>0 then *Q2Ji9}.M4D,a
browserVer="Internet Explorer 5.00" }C(WYG#S;Fw
elseif Instr(agent,"MSIE 4.0")>0 then ~-D/_V+q_D3g.VO
browserVer="Internet Explorer 4.0"
fp&fWf+P else
5}uU`U*V browserVer="未知" urA#CT6D!~K
end if P A6\6^ E'p]5hR
browser="您的浏览器版本: " & browserVer
:n/H I[rJ!y if Instr(agent,"TencentTraveler")>0 then '检查是否正在使用腾讯TT Wm5zX"u2zrm4R
browser=browser&" |目前正使用TencentTraveler"
c$G*^d vy5a5u end if
l)d|6w#Fk%d end function %>[/code]

页: [1]
【捌玖网络】已经运行:


Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.