天枫常用的ASP函数封装如下(8)
Public Function GetIP()
Dim Temp
Temp = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If Temp = "" or isnull(Temp) or isEmpty(Temp) Then Temp = Request.ServerVariables("REMOTE_ADDR")
If Instr(Temp,"'")>0 Then Temp="0.0.0.0"
GetIP = Temp
End Function
'****************************************************
'函数名:GetBrowser
'作 用:获取客户端浏览器信息
'返回值:客户端浏览器信息
'****************************************************
Public Function GetBrowser()
info=Request.ServerVariables(HTTP_USER_AGENT)
if Instr(info,"NetCaptor 6.5.0")>0 then
browser="NetCaptor 6.5.0"
elseif Instr(info,"MyIe 3.1")>0 then
browser="MyIe 3.1"
elseif Instr(info,"NetCaptor 6.5.0RC1")>0 then
browser="NetCaptor 6.5.0RC1"
elseif Instr(info,"NetCaptor 6.5.PB1")>0 then
browser="NetCaptor 6.5.PB1"
elseif Instr(info,"MSIE 5.5")>0 then
browser="Internet Explorer 5.5"
elseif Instr(info,"MSIE 6.0")>0 then
browser="Internet Explorer 6.0"
elseif Instr(info,"MSIE 6.0b")>0 then
browser="Internet Explorer 6.0b"
elseif Instr(info,"MSIE 5.01")>0 then
browser="Internet Explorer 5.01"
elseif Instr(info,"MSIE 5.0")>0 then
browser="Internet Explorer 5.00"
elseif Instr(info,"MSIE 4.0")>0 then
browser="Internet Explorer 4.01"
else
browser="其它"
end if
End Function
'****************************************************
'函数名:GetSystem
'作 用:获取客户端操作系统
'返回值:客户端操作系统
'****************************************************
Function GetSystem()
info=Request.ServerVariables(HTTP_USER_AGENT)
if Instr(info,"NT 5.1")>0 then
system="Windows XP"
elseif Instr(info,"Tel")>0 then
system="Telport"
elseif Instr(info,"webzip")>0 then
内容版权声明:除非注明,否则皆为本站原创文章。