visitorinfo.asp
来自「一套设计完善、高效的web商城解决方案」· ASP 代码 · 共 85 行
ASP
85 行
<%
FUNCTION TranSIP(SIP)
TIP=cstr(SIP)
SIP1=left(TIP,cint(instr(TIP,".")-1))
TIP=mid(TIP,cint(instr(TIP,".")+1))
SIP2=left(TIP,cint(instr(TIP,".")-1))
TIP=mid(TIP,cint(instr(TIP,".")+1))
SIP3=left(TIP,cint(instr(TIP,".")-1))
SIP4=mid(TIP,cint(instr(TIP,".")+1))
TranSIP=cint(SIP1)*256*256*256+cint(SIP2)*256*256+cint(SIP3)*256+cint(SIP4)
END FUNCTION
Dim VisitorAddress,IPconn,IPconnstr,IPrs,TheIP
TheIP=TranSIP(IP)
IPDb="/"&SysPath&"Config/IP.asp"
Set IPconn = Server.CreateObject("ADODB.connection")
IPconnstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&IPDb&"")
IPconn.open IPconnstr
set IPrs=IPconn.execute("select * from IP where (IP1<=" & TheIP & " and IP2>=" & TheIP & ")")
If IPrs.EOF then
VisitorAddress="δ֪"
Elseif Trim(IPrs("Country"))="IANA" or Trim(IPrs("City"))="IANA" then
VisitorAddress="IANA"
Else
VisitorAddress=Trim(IPrs("Country"))&Trim(IPrs("City"))
End If
IPrs.close
set IPrs = nothing
IPconn.close
set IPconn = nothing
Dim OS,Browser,SystemInfo
SystemInfo=Request.ServerVariables("HTTP_USER_AGENT")
SystemInfo=Split(SystemInfo,";")
If InStr(SystemInfo(1),"MSIE")>0 Then
Browser="MS IE "
Version=Trim(Left(Replace(SystemInfo(1),"MSIE",""),6))
ElseIf InStr(SystemInfo(4),"Netscape")>0 Then
Browser="Netscape "
Dim Tmpstr
Tmpstr=Split(SystemInfo(4),"/")
Version=Tmpstr(UBound(Tmpstr))
ElseIf InStr(SystemInfo(4),"rv:")>0 Then
Browser="Mozilla "
Tmpstr=Split(SystemInfo(4),":")
Version=Tmpstr(UBound(Tmpstr))
If InStr(version,")") > 0 Then
Ttmpstr=Split(Version,")")
Version=Tmpstr(0)
End If
End If
If InStr(SystemInfo(2),"NT 5.2")>0 Then
OS="Windows 2003"
ElseIf InStr(SystemInfo(2),"Windows CE")>0 Then
OS="Windows CE"
ElseIf InStr(SystemInfo(2),"NT 5.1")>0 Then
OS="Windows XP"
ElseIf InStr(SystemInfo(2),"NT 5.0")>0 Then
OS="Windows 2000"
ElseIf InStr(SystemInfo(2),"NT 4.0")>0 Then
OS="Windows NT"
ElseIf InStr(SystemInfo(2),"NT")>0 Then
OS="Windows NT"
ElseIf InStr(SystemInfo(2),"9x")>0 Then
OS="Windows ME"
ElseIf InStr(SystemInfo(2),"98")>0 Then
OS="Windows 98"
ElseIf InStr(SystemInfo(2),"95")>0 Then
OS="Windows 95"
ElseIf InStr(SystemInfo(2),"Win32")>0 Then
OS="Win32"
ElseIf InStr(SystemInfo(2),"Linux")>0 Then
OS="Linux"
ElseIf InStr(SystemInfo(2),"SunOS")>0 Then
OS="SunOS"
ElseIf InStr(SystemInfo(2),"Mac")>0 Then
OS="Mac"
Else
OS="δ֪"
End If
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?